This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

节点参考

Node Reference is a node that refers to a .node file in the project directory, which is obtained by exporting a node from the world. Node Reference是一个指向项目目录中的.node文件的节点,该文件由从world导出获得。

注意
The world can contain several Node References referring to the same .node file.世界可以包含多个引用同一个.node文件的Node References

The .node file usually contains a pre-fabricated node (or a hierarchy of nodes) with links to all materials and properties and configured physical bodies that are required for its rendering and behaviour. All changes made for the Node Reference content via UnigineEditor are saved into this file..node文件通常包含一个预制的节点(或节点的层次结构),其中链接到其呈现和行为所需的所有材质和属性以及配置的物理主体。通过UnigineEditor对Node Reference内容所做的所有更改都保存到这个文件中。

Node References should be used if a lot of identical objects are placed in the world: unlike regular nodes, Node Reference are loaded into the world faster because of the internal cache usage.如果在世界中放置了许多相同的对象,则应该使用Node References:与常规节点不同,Node Reference加载到世界中更快,因为内部缓存的使用。

Using Node Reference enables to avoid manual editing each identical object if you need to make the same changes in all of them. You can simply add several Node References that point to one .node file and then edit only one Node Reference in order to update them all. Such approach enables to hold to integrity of instanced objects, especially if they are complex and sophisticated.如果需要对所有对象进行相同的更改,使用Node Reference可以避免手动编辑每个相同的对象。 您可以简单地添加几个Node References,指向一个.node文件,然后只编辑一个Node Reference,以便更新它们全部。 这种方法能够保持实例对象的完整性,特别是如果它们是复杂和复杂的。

注意
Each Node References has its internal copy of nodes loaded from the .node asset, therefore all node references are updated only when saving changes to the asset.每个Node References都有从.node资源加载的内部节点副本,因此只有在保存对资源的更改时才会更新所有节点引用。

For example, the Node Reference can be used to add identical vehicles, characters, or buildings that should have the same look and behaviour and be updated at once, if necessary.例如,Node Reference可用于添加具有相同外观和行为的相同车辆、角色或建筑,并在必要时立即更新。

Boats added as Node References船作为节点引用添加

Node References support nesting, i.e. a Node Reference can include other Node References which is helpful for implementing complex instancing solutions.Node References支持嵌套,即Node Reference可以包含其他Node References,这有助于实现复杂的实例化解决方案。

Watch the following tutorial to learn the important things about Node Reference:观看下面的教程,了解关于Node Reference的重要事情:

Important Notes
重要的笔记#

注意
A Node Reference can contain only one root node.一个Node Reference只能包含一个根节点。

Referencing Content Outside
引用外部内容#

A Node Reference should be thought of as a container for a self-sufficient hierarchy of nodes. When designing your world in UnigineEditor, avoid referencing nodes that are stored in a Node Reference directly from the outside (e.g. when manipulating nodes via Tracker, creating physical joints, specifying nodes in component parameters or the target node of a Player Persecutor) as such references will be lost as soon as the world is reloaded.Node Reference应该被认为是一个容器,用于存放自给自足的节点层次结构。当在UnigineEditor中设计你的世界时,避免直接从外部引用存储在Node Reference中的节点(例如,当通过 Tracker操作节点时,创建物理关节,指定组件参数目标节点Player tor),因为这样的引用将在世界重新加载时丢失。

Transformations
转换#

The transformation of a Node Reference is not affected by the transformation of the nodes stored by it. Thus, logic-driven and physics-driven nodes inside a Node Reference will make no influence on its direct children.Node Reference的转换不受其存储的节点的转换的影响。因此,Node Reference中的逻辑驱动和物理驱动节点不会对其直接子节点产生影响。

In the following example, the moving grouped Node_1 and Node_2 nodes (e.g. driven by physics) contained by a Node Reference will not modify the transformation of the Node Reference and, therefore, the DirectChild node will not be affected as well.在下面的例子中,由Node Reference包含的移动分组 Node_1Node_2节点(例如,由物理驱动)将不会修改Node Reference的转换,因此,DirectChild节点也不会受到影响。

Schematic representation of a Node Reference content.Node Reference内容的示意图表示。

So, it is recommended to enclose all interconnected nodes in a single Node Reference to ensure logical and hierarchical integrity.因此,建议将所有相互连接的节点封装在一个Node Reference中,以确保逻辑和层次的完整性。

See Also
另请参阅#

Creating a Node Reference
创建节点参考#

There are two ways to create a Node Reference via UnigineEditor:有两种方法通过UnigineEditor创建Node Reference:

  • Create a Node Reference from a previously created .node asset. In this case, you should export a node into a .node file first.创建一个节点引用从一个以前创建的.node资源。在这种情况下,您应该先出口节点到.node文件。

  • Convert a node with all its child nodes present in the nodes hierarchy list into a Node Reference. In this case, the source node will change its type to a Node Reference.将节点及其在节点层次结构列表中的所有子节点转换为Node Reference。在本例中,源节点将其类型更改为Node Reference

By Using a Node Asset
通过节点资源使用#

  1. Export a node into a .node file or import the desired node file to the project. 将节点导出到.node文件import所需的node文件到项目中。
  2. Add the Node Reference to the world by either of the following ways:添加Node Reference世界通过以下方式:

    • On the Menu bar, click Create -> Node -> Reference and select the desired .node asset in the window that opens:在菜单栏上,单击Create -> Node -> Reference,并在打开的窗口中选择所需的.node资源:

      警告
      It is not recommended to select a geometry container (.fbx, .dae, .gtlf, etc.) as the changes made to its node runtime will not be saved when reimporting the asset.不建议选择几何容器>
    • Drag the .node asset from the Asset Browser window..node 资源Asset Browser窗口拖拽。

You can repeat Step 2 in order to add the required number of Node References. Or you can simply clone the added node.你可以重复步骤2以添加所需数量的Node References。或者你可以简单地克隆>

Several Node References with the red material applied应用了几个带有红色材质的节点引用

By Converting an Existing Node
通过将现有的节点#

  1. Select a node in the World Nodes Hierarchy window (or directly in the scene).World Nodes Hierarchy窗口中选择一个节点(或直接在现场 )。
  2. On the Menu bar, click Edit -> Convert to NodeReference (or press Ctrl+Shift+G).在菜单栏上单击“Edit -> Convert to NodeReference”(或按“Ctrl+Shift+G”)。

As a result, a new .node asset is created at the current folder and the source node is converted into the Node Reference:因此,创建一个新的.node资源在当前文件夹,源节点转换为Node Reference:

Source node to be converted需要转换的源节点
Converted node转换节点

You can also clone the converted node in order to get the required number of Node References.您也可以 clone转换的节点,以获得所需的Node References的数目。

注意
If you select several nodes and convert them into a Node Reference, they are saved into a .node file as child nodes of a Dummy Node.如果您选择多个节点并将它们转换为Node Reference,它们将作为Dummy Node的子节点保存到 .node 文件中。
Source nodes to be converted需要转换的源节点
Nodes grouped under a Dummy Node to which Node Reference refers分组在节点引用引用的Dummy Node下的节点

Editing a Node Reference
编辑节点参考#

In the Reference section of the Node tab, you can change the asset of the source node or open the ReferenceNode Editor used to edit the source node: Node标签的Reference部分,您可以更改源节点的资源或打开用于编辑源节点的ReferenceNode Editor:

A node asset节点资源

To edit the source node, to which the Node Reference points:编辑的源节点,Node Reference点:

  1. Select the Node Reference in the World Nodes Hierarchy window.World Nodes Hierarchy窗口中选择Node Reference
  2. Click Edit in the Node tab of the Parameters window.单击Parameters窗口的Node选项卡中的Edit

    The source node becomes available in the World Nodes Hierarchy window as a child of the Node Reference and can be edited via the Parameters window.源节点可用在World Nodes Hierarchy窗口作为一个孩子节点的引用,并可以通过编辑Parameters窗口。

    World Nodes Hierarchy window: source node in the edit modeWorld Nodes Hierarchy窗口:编辑模式下的源节点
  3. Edit the source node. For example, you can change the material applied to it:编辑源节点。例如,您可以更改应用到它的材质:

    Node References with the red material applied节点引用的红色材质的应用
    Node References with the changed material带有已更改内容的节点引用

    You can also reorganize hierarchy and replace the source nodes, but keep note that only the first child will be saved in the Node Reference as Node Reference can contain only one root node.您还可以重新组织层次结构并替换源节点,但请注意只有第一个子节点将保存在Node Reference中作为Node Reference 只能包含一个根节点

  4. After all changes are made, select the parent node in the World Nodes Hierarchy window and click Apply to save changes to the source node or Cancel changes to keep nodes unchanged.所有更改完成后,在World Nodes Hierarchy窗口中选择父节点并单击Apply将更改保存到源节点或取消更改以保持节点不变。

    Reference section in the Node tab of the parent Node ReferenceReferenceNode选项卡的父节点参考

It is also possible to quick-replace the source node with another one stored in the same folder. To do that, select a Node Reference in the World Nodes Hierarchy window or the Viewport, hold Shift and use the mouse wheel or Page Up and Page Down buttons.也可以将源节点快速替换为存储在同一文件夹中的另一个节点。为此,在World Nodes Hierarchy窗口或Viewport中选择一个Node Reference,按住Shift并使用鼠标滚轮或Page UpPage Down按钮。

Deleting a Node Reference
删除节点参考#

You can delete the Node Reference the same way as any other node.您可以删除Node Reference一样其他节点>

最新更新: 2024-04-19
Build: ()