This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
创建内容
Content Optimization
Materials
Art Samples
Tutorials

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也可以看看#

Adding a Switcher添加切换台#

To add Switcher to the scene via UnigineEditor, do the following:要通过UnigineEditor将Switcher添加到场景中,请执行以下操作:

  1. Run the project with UnigineEditor.跑步UnigineEditor的项目。
  2. On the Menu bar, click Create -> Optimization -> Switcher.在菜单栏上,单击Create -> Optimization -> Switcher

  3. Place the node somewhere in the world.将节点放置在世界上的某个地方。
  4. Make the node that will be controlled by Switcher a child of the latter.使将由Switcher控制的节点孩子后者。
  5. 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:要在指定距离(如上图所示)之间在两个对象之间切换,请执行以下操作:

  1. Create a Node Dummy for convenient grouping.创建一个Node Dummy以方便分组。
  2. Make the first Switcher the child of the Node Dummy.使第一个Switcher孩子Node Dummy中的
  3. Make the first object the child of the first Switcher and specify its maximum visibility distance.使第一个对象成为孩子的第一个Switcher并指定其最大可见距离
  4. Make the second Switcher the child of the Node Dummy.使第二个Switcher孩子Node Dummy中的
  5. 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选项卡
Min Distance The minimum distance of visibility, in units. If the camera is closer to a node than this minimum distance, the node is not visible.最小可见距离,以单位为单位。如果摄像机比最小距离更接近节点,则该节点不可见。
Max distance The maximum distance of visibility, in units. If the camera is further from a node than this maximum distance, the node is not visible.最大可见距离,以单位为单位。如果摄像机距离节点的距离超过此最大距离,则该节点不可见。
最新更新: 2021-05-26
Build: ()