Switcher
Switcher is an object that disables or enables its child nodes at a specified distance from the camera. Possible use cases are: Switcher是一个对象,该对象在距摄像机指定距离处禁用或启用其子节点。可能的用例是:
- Enabling one object and disabling another at a specified distance启用一个对象并在指定距离禁用另一个对象
- Disabling an object while moving away离开时禁用对象
- Enabling an object while approaching靠近时启用对象
Each object is composed of Switcher and two spheres of different colors每个对象都由Switcher和两个不同颜色的球体组成
See Also也可以看看#
- The WorldSwitcher class to manage Switcher via API通过API管理Switcher的WorldSwitcher类
Adding a Switcher添加切换台#
To add Switcher to the scene via UnigineEditor, do the following:要通过UnigineEditor将Switcher添加到场景中,请执行以下操作:
- Run the project with UnigineEditor.跑步UnigineEditor的项目。
-
On the Menu bar, click Create -> Optimization -> Switcher.在菜单栏上,单击Create -> Optimization -> Switcher。
- Place the node somewhere in the world.将节点放置在世界上的某个地方。
- Make the node that will be controlled by Switcher a child of the latter.使将由Switcher控制的节点孩子后者。
- Specify the enabling and the disabling distance in the Switcher parameters.指定启用和禁用距离在Switcher参数中。
Switching between Two Objects在两个对象之间切换#
To switch between two object at the specified distance (like shown in the picture above), do the following:要在指定距离(如上图所示)之间在两个对象之间切换,请执行以下操作:
- Create a Node Dummy for convenient grouping.创建一个Node Dummy以方便分组。
- Make the first Switcher the child of the Node Dummy.使第一个Switcher孩子Node Dummy中的
- Make the first object the child of the first Switcher and specify its maximum visibility distance.使第一个对象成为孩子的第一个Switcher并指定其最大可见距离。
- Make the second Switcher the child of the Node Dummy.使第二个Switcher孩子Node Dummy中的
- Make the second object the child of the second Switcher and specify its minimum visibility distance.使第二个对象成为孩子第二个Switcher并指定其最小可见距离。
To make objects switch at the same point, the maximum visibility distance of the first one and minimum visibility distance of the second one should match.为了使对象在同一点切换,第一个对象的最大可见距离和第二个对象的最小可见距离应匹配。
Switcher Parameters切换台参数#
In the Node tab of the Parameters window, you can adjust the following parameters of Switcher:在Parameters窗口的Node选项卡中,可以调整Switcher的以下参数:
Node tab of the WorldSwitcher nodeWorldSwitcher节点的Node选项卡
最新更新:
2023-12-19
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)