This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
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

属性

For the object to be correctly integrated into the world, defining its position, inherent characteristics and outside appearance will be insufficient. Properties specify the way the object will behave and interact with other objects and the scene environment.为了使物体正确地融入世界,定义其位置,固有特性和外观将是不够的。 属性指定对象的行为方式以及与其他对象和场景环境的交互方式。

What is a Property?
什么是属性?#

A property can be thought of as a "material" for application logic. It represents a set of logic-related parameters. You can define conditions, based on which parameters of the property become available/unavailable in the UnigineEditor.可以将属性视为应用程序逻辑的“材质”。它代表一组与逻辑相关的 参数 。您可以根据属性的哪些参数在 UnigineEditor 中变得可用/不可用来定义条件

Property parameters can be of various types - from a simple integer representing your character's hit points, to node, material, file (for textures, meshes, sounds, etc.), or property, which simplifies access to various resources.属性参数可以有多种类型-从代表角色命中点的简单整数节点,材质,文件(用于纹理,网格,声音等),或属性,从而简化了对各种资源的访问。

You can also use complex data types in your properties which provides additional flexibility to implement your application logic. These data types are as follows:您还可以在属性中使用复杂的数据类型,这为实现应用程序逻辑提供了更大的灵活性。这些数据类型如下:

  • Structure can be thought of as "a definition of a property inside a property". Thus, a structure is also composed of parameters of any type supported by the property, including arrays.Structure-可以认为是“属性内属性的定义”。因此,结构也由属性支持的任何类型的参数组成,包括数组

    Structures, just like properties, can also include other structures (nested) and can be organized in hierarchy with parameter inheritance and overloading (much like in object-oriented programming). When a structure is inherited, all its parameters are inherited from the parent. If a parameter value is changed for the parent, it will be automatically changed for the child as well, unless it was overridden (set to a different value) for the child before that.与属性一样,结构也可以包含其他结构(嵌套),并且可以通过层次结构进行组织,并具有参数继承和重载功能(类似于面向对象的编程)。继承结构时,其所有参数均从父级继承。如果为父项更改了参数值,则该参数值也将为子项自动更改,除非在此之前为子项覆盖(设置为其他值)。

    注意
    In case if a property has a structure parameter (struct), the definition of this structure inside the *.prop file must appear before the parameter. The same is true, when a structure inherits from another structure: the parent must be defined before its child.如果属性具有结构参数( struct ),则*.prop文件中此结构的定义必须出现在参数之前。当一个结构继承自另一个结构时,情况也是如此:父级必须在其子级之前定义。
  • Array is a collection of parameters, all having the same type, and accessed using a common name followed by an index: array[0].Array-它是参数的集合,所有参数都具有相同的类型,并使用通用名称后跟索引进行访问: array [0]

    Arrays can have multiple dimensions (arrays of arrays), but be careful: the amount of memory needed for an array increases exponentially with each dimension. Arrays of structures are also supported.数组可以具有多个维度(数组的数组),但要小心:数组所需的内存量随每个维度呈指数增长。还支持结构的数组。

UNIGINE's Properties system includes the following:UNIGINE的属性系统包括以下内容:

All properties in the project are organized in a hierarchy.项目中的所有属性都按层次结构进行组织。

Each property is stored in a separate *.prop file, except for the internal properties.除了内部属性,每个属性都存储在单独的 *.prop文件中。

Manual Properties
手动属性#

Manual properties are created and edited manually: they are displayed as read-only in the UnigineEditor. It is possible to modify them via API at run time (if the corresponding flag is set), but such changes won't be saved. To customize a manual property, you should either inherit a new user property from it or directly edit the corresponding *.prop file.手动属性是手动创建和编辑的:它们在UnigineEditor中显示为只读。可以在运行时通过 API 修改它们(如果设置了相应标志),但不会保存此类更改。要自定义手动属性,您应该从中继承一个新的用户属性或直接编辑相应的*.prop文件。

注意
When inheriting from a property, the parent passes all its parameters to the child. If the parent property is modified later, all inherited properties that are not overridden will be updated automatically.从属性继承时,父级将其所有参数传递给子级。如果稍后修改了父属性,则所有未覆盖的继承属性将自动更新。

In the *.prop file of a manual property its name is stored. If a manual property is inherited from another manual property, the child's *.prop file will store a name-based reference to the parent. The GUID for the manual property is uniquely determined by its name and is generated at run time.在手册属性的*.prop文件中,存储了其名称。如果一个手册属性是从另一个手册属性继承的,则子级的*.prop文件将向父级存储一个基于名称的引用。 manual属性的 GUID 由其名称唯一确定,并在运行时生成。

Base Properties
基本属性#

Base property is a manual property that does not have a parent, base properties are at the top-level of the hierarchy, all other properties are inherited from them.基本属性是没有父级的manual属性,基本属性位于层次结构的顶层,所有其他属性均继承自它们。

By default, UNIGINE provides 2 built-in read-only base properties: node_base and surface_base. You can also make custom base properties of your own.默认情况下,UNIGINE提供2内置的只读基本属性:node_basesurface_base。您还可以创建自己的自定义基本属性。

User Properties
用户属性#

User property is a property inherited from any other property via the UnigineEditor, it overrides the parameters of its parent.用户属性是通过 UnigineEditor 从任何其他属性继承的属性,它覆盖其父级的参数。

The *.prop file of the user property contains its GUID and a GUID-based reference to the parent property. Such file is created automatically when inheriting a new property in the UnigineEditor. The set of user property parameters is determined by its parent, while their values can be modified.用户属性的*.prop文件包含其 GUID 和对父属性的基于 GUID的引用。在UnigineEditor中继承新属性时,会自动创建此类文件。用户属性参数集由其父级确定,而其值可以修改。

Internal Properties
内部属性#

Internal property is a property without a name. When cloning or inheriting a property, each new property becomes internal until a name is assigned to it. Internal properties are also created when you assign a property to a node.内部属性是没有名称的属性。克隆或继承属性时,每个新属性都将变为内部属性,直到为其分配了名称。当您将属性分配给节点时,也会创建内部属性。

注意
Instanced properties assigned to nodes are saved in a *.node or a *.world file.分配给节点的实例化属性保存在*.node*.world文件中。

See Also
也可以看看#

  • Hierarchy and Inheritance article to learn more about how properties are organized. 层次结构和继承 文章,以了解有关如何组织属性的更多信息。
  • Property GUIDs chapter to learn how to refer to manual and user properties. 属性GUID 一章,以学习如何引用手册和用户属性。
  • Property File Format article to learn more about the *.prop files. 属性文件格式 一文,以了解有关*.prop文件的更多信息。
  • Properties class article to learn more about managing properties via API. 属性 类文章,以了解有关通过API管理属性的更多信息。
  • Property class article to learn more about managing a property via API.Property类文章,以了解有关通过API管理属性的更多信息。
  • PropertyParameter class article to learn more about managing property parameters via API.PropertyParameter类文章,以了解有关通过API管理属性参数的更多信息。
最新更新: 2024-08-16
Build: ()