This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine语言对象符号(ULON)

ULON (Unigine Language Object Notation) is a universal format used in UNIGINE to describe complex structures similar to classes in Object-Oriented Programming. Landscape Terrain brushes as well as some of UNIGINE built-in materials are described using ULON. ULON(统一语言对象表示法)是UNIGINE中用于描述类似于面向对象编程中的类的复杂结构的通用格式。使用ULON描述了Landscape Terrain画笔以及一些UNIGINE内置材质。

The Engine supports loading and parsing files containing ULON-declarations, but does not support saving ULON-based structures to a file as such declarations are treated more like source code.引擎支持加载和解析包含ULON声明的文件,但是不支持将基于ULON的结构保存到文件中,因为这样的声明更像源代码。

ULON Description Example ULON说明示例

ULON Description Example

See Also也可以看看#

Nodes节点数#

The basic element (building brick) of ULON is called a node. Each node has a type, a name, and a value. ULON的基本元素(建筑用砖)称为节点。每个节点都有一个类型(type),一个名称(name)和一个 值value

The following construct is used to declare a node:以下构造用于声明节点:

ULON Node Declaration

Both node name and type are written as strings:节点名称 type 均被写为字符串:

  • either a quoted string with standard escape characters,带有标准转义字符的带引号的字符串
  • or a bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_".裸词,以小写字母开头,仅包含字母,数字和下划线"_"。

Here is an example:这里是一个示例:

源代码
"Node Type" "node name" = node_value
NodeType node_name1 = node_value

Node declarations can be nested, thus forming a hierarchy. So a node can have a parent and an unlimited number children.

源代码
Node parent
{
	Node child_0
	Node child_1
	{
		Node child_2
		Node child_3
	}
}
节点声明可以嵌套,从而形成层次结构。因此,一个节点可以有一个父节点和不限数量的子节点。

源代码
Node parent
{
	Node child_0
	Node child_1
	{
		Node child_2
		Node child_3
	}
}

Values价值观#

ULON node values can be of the following types:ULON节点值可以是以下类型:

  • Boolean
    Node my_node = true
    布尔值
    _ Node my_node = true
  • Integer number
    Node my_node = 1234
    整数编号
    _ Node my_node = 1234
  • Floating-point number
    Node my_node = 3.1459
    浮点数
    _ Node my_node = 3.1459
  • String
    • Quoted string with standard escape characters:
      Node node = "word word"
      Quoted string with standard escape characters:
      Node node = "word word"
    • Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
      Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
    • Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
      Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
    Quoted string with standard escape characters:
    Node node = "word word"Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
    Node node = word1_word2 Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
    Node my_node = #{C++ C# USC HLSL GLSL USSL#}
    字符串
    • Quoted string with standard escape characters:
      Node node = "word word"
      带标准转义字符的带引号的字符串:
      Node node = "word word"
    • Bare word, beginning with a lower case letter, containing only letters, digits, and underscores "_":
      Node node = word1_word2
      裸词,以小写字母开头,仅包含字母,数字和下划线"_":
      Node node = word1_word2
    • Heredoc string enclosed in #{ ... #}. This type can be used for code fragments (e.g., shader code embedded into material description):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
      包含在#{ ... #}中的Heredoc字符串。此类型可用于代码片段(例如,嵌入到材质描述中的着色器代码):
      Node my_node = #{C++ C# USC HLSL GLSL USSL#}
  • Array containing a finite number of integer, float, and string elements
    Node my_node = [100, 0.2, str str "str str str", #{vec4 asd = vec4_zero;#}]
    This array has the following 6 elements:
    • 100
    • 0.2
    • str
    • str
    • str str str
    • vec4 asd = vec4_zero;
    数组 ,其中包含有限数量的integer, float string 元素
    Node my_node = [100, 0.2, str str "str str str", #{vec4 asd = vec4_zero;#}] 该数组具有以下 6 元素:
    • 100
    • 0.2
    • str
    • str
    • str str str
    • vec4 asd = vec4_zero;

Arguments争论#

ULON argument is a name - value pair (name = value). Arguments are additional parameters that can be associated with ULON nodes and used for various purposes (e.g. to define a tooltip or a title for a material parameter declaration). Arguments are enclosed in angle brackets < > and can be separated using "\t","\n","\r", as well as commas and spaces. ULON 参数是一个名称-值对(名称=值)。参数是可以与ULON节点关联并用于各种目的的其他参数(例如,为材质参数声明定义工具提示或标题)。参数包含在尖括号< >中,可以使用“ \ t”,“ \ n”,“ \ r”以及逗号和空格分隔。

Example: 示例:

ULON Arguments Declaration

Conditions条件#

For each node a logical condition can be specified, if the condition fails the ULON node with all its children is ignored. Thus you can dynamically build the hierarchy of ULON nodes with a great degree of flexibility. This can be useful when the contents of the node depends on certain parameters, e.g. a shader to be used is defined by the rendering pass. 对于每个节点,可以指定一个逻辑条件,如果条件失败,则忽略带有所有子级的ULON节点。因此,您可以高度灵活地动态构建ULON节点的层次结构。当节点的内容取决于某些参数时,例如,这可能是有用的。渲染过程定义要使用的着色器。

注意
Conditions are not parsed and executed automatically, processing of conditions is the responsibility of the user of the ULON format (e.g. in case of materials UnigineScript and UUSL are used).条件不会自动解析和执行,条件处理是ULON格式的用户的责任(例如,使用材质 UnigineScript UUSL

Conditions are specified after the node's name, starting with the if keyword, the condition itself is enclosed in brackets [ ... ].条件是在节点名称后指定的,从if关键字开始,条件本身放在方括号中[ ... ].

Condition of the parent node is added to the condition of the child: (parent_conditon) && (child_conditon)父节点的条件添加到子节点的条件:(parent_conditon) && (child_conditon)

Example:示例:

源代码
Node parent if[var1 == 10 || var1 == 5]
{
	Node child_0  if[var2 == 3]
	Node child_1  if[var2 == 4]
	{
		Node child_2 if[var3 != 11]
		ode child_3 if[var3 != 25]
	}
}

The resulting conditions for each node are as follows:每个节点的结果条件如下:

  • parent condition: (var1 == 10 || var1 == 5)
  • child_0 condition: (var1 == 10 || var1 == 5) && (var2 == 3)
  • child_1 condition: (var1 == 10 || var1 == 5) && (var2 == 4)
  • child_2 condition: (var1 == 10 || var1 == 5) && (var2 == 4) && (var3 != 11)
  • child_3 condition: (var1 == 10 || var1 == 5) && (var2 == 4) && (var3 != 25)

Comments评论#

Adding comments make object declaration easier to understand, especially if the object is a complex one. The following types of comments are supported:添加注释使对象声明更易于理解,尤其是在对象是复杂对象的情况下。支持以下类型的os注释:

  • single-line comments starting with "//":
    // This is a single-line comment
    单行以"//"开头的注释:
    // This is a single-line comment
  • multi-line comments enclosed within "/*" and "*/":
    /* This is
    a multi-line
    comment */
    包含在 "/*"和"*/"内的多行注释:
    /* This is
    a multi-line
    comment */
最新更新: 2023-06-21
Build: ()