This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Программирование
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Trigger

A   trigger is a zero-sized node that has no visual representation and fires callbacks when it is enabled/disabled (an enabled callback function is called) or its transformation is changed (a position callback function is called). The trigger node is usually added as a child node to another node, so that the callbacks will be fired on the parent node enabling/disabling or transforming.

Notice
The enabled and position callback functions should be implemented in the world script.
The trigger nodes can work with procedurally created world cluster and world clutter objects. For example, a trigger node can be added as a child to a node that is baked into a world cluster in order to fire theenabled callback when the cluster renders this node (i.e. enables it).

The trigger node can be used, for example, to play a sound of thunder when a lightning flashes: when a lightning node is enabled, the enabled callback function that plays a sound is called

Lightning Node Enabled

See also

  • A NodeTrigger class to edit triggers via UnigineScript

Adding a Trigger Node

To add a new trigger node via UnigineEditor, click Create -> Node -> Trigger on the Menu bar and then place the trigger node in the world.

Place a Trigger Node

Then you should add the trigger node as a child to a node for which callbacks should be fired: select the trigger node in the World Hierarchy window and drag it inside the required node.

Editing a Trigger Node

To edit the trigger node, select it and go to the Node Trigger tab of the Parameters window. On this tab, you can specify the callback functions that will be called when the node trigger or its parent node is enabled/disabled or transformed.

Trigger Node Settings

The callback functions must be implemented in the world script (on UnigineScript side). The enabled and position callback functions should receive a trigger node that fired the callback as its first argument. However, they can also receive a node or even no arguments at all.

Notice
The callback function can also take 2 additional arguments. However, you can set such callbacks via the code only. Via UnigineEditor, you can only specify the callback functions that receive 0 or 1 argument.
Last update: 10.08.2018
Build: ()