Files
Mitchell Wilson 0b47855b71 Copying //UE4/Dev-Documentation to Samples-Main (//UE4/Samples-Main) CL - 4860397
#rb none

[CL 4860421 by Mitchell Wilson in Main branch]
2019-01-31 15:30:04 -05:00

73 lines
3.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
INTSourceChangelist:3599948
Availability:Public
Title:BuildGraph 脚本条件
Crumbs:
Description:学习编写 BuildGraph 脚本条件所需的语法。
version:4.13
parent:Programming/Development/BuildGraph
type:Reference
tags:Programming
tags:BuildGraph
[VAR:TopicCompact]
[OBJECT:TopicCompact]
[PARAM:image]
![%Programming/Development/BuildGraph/ScriptAnatomy/Conditions%](conditional_topic.png)
[/PARAM]
[PARAM:icon]
![](%ROOT%/reference_icon.png)(convert:false)
[/PARAM]
[PARAM:title]
%Programming/Development/BuildGraph/ScriptAnatomy/Conditions:title%
[/PARAM]
[PARAM:description]
%Programming/Development/BuildGraph/ScriptAnatomy/Conditions:description%
[/PARAM]
[PARAM:path]
[RELATIVE:Programming/Development/BuildGraph/ScriptAnatomy/Conditions]
[/PARAM]
[/OBJECT]
[/VAR]
[TOC(start:1 end:3)]
[EXCERPT:BuildGraphScriptConditions]
如果需要将逻辑复杂性加入 BuildGraph 脚本,则需要使用条件语句。以下部分将介绍 BuildGraph 条件的编写方式,包括一个条件运算符列表。
(#Conditions)
## 条件
BuildGraph 脚本条件由求值为 `true` 或 `false` 的原子和运算符构成。
(#Atoms)
### 原子
原子可以是数字、字符串或辨识符,它们将强制成为合适的类型,以便运算符对其进行使用。原子可以包含在单引号(')或双引号(")中。它们也可以是不带引号的字母、数字和带下划线字符的序列。无论对它们如何进行声明,所有原子的类型均视为相同。此外,原子对比时不区分大小写,意味着字符串 "True" 和 'true' 与辨识符 `true` 相同(无视大小写和引号的不同)。
(#Operators)
## 运算符
运算符列表说明如下:
| **运算符** | **描述** | **优先权** |
| ----------------------- | --------------------------------------------------------------------------- | --------------- |
| `(x)` | 子表达式 | 1 |
| `!x` | 非运算符 | 1 |
| `Exists(x)` | 如 x 文件存在则为 True。| 1 |
| `HasTrailingSlash(x)` | 如 x 以斜杠或反斜杠结尾则为 True| 1 |
| `x == y` | 测试两个原子的相等性(不区分大小写)。| 2 |
| `x != y` | 测试两个原子的不等性(不区分大小写)。 | 2 |
| `x < y` | 对比整数 x 是否小于整数 y。| 2 |
| `x < y` | 对比整数 x 是否小于或等于整数 y。| 2 |
| `x < y` | 对比整数 x 是否大于整数 y。| 2 |
| `x < y` | 对比整数 x 是否大于或等于整数 y。| 2 |
| `x and y` | 如两个参数均为 `true`,则为 True。| 3 |
| `x and y` | 如任意参数为 `true`,则为 True。| 4 |
[REGION:note]
`'<'` 和 `'>'` 字符必须被换码为 XML 中的 `"&lt;"` 和 `"&gt;"`。
[/REGION]
[/EXCERPT:BuildGraphScriptConditions]