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
Objects-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). A Node Trigger 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 Node Trigger can work with procedurally created World Cluster and World Clutter objects. For example, a Node Trigger can be added as a child to a node that is baked into a World Cluster in order to fire the enabled callback when the cluster renders this node (i.e. enables it).

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

Lightning node enabled

See also#

Adding a Node Trigger#

To add a new Node Trigger via UnigineEditor do the following:

  1. Run UnigineEditor.
  2. On the Menu bar, click Create -> Logic -> Node Trigger.

  3. Place the Node Trigger in the world.

  4. Add the Node Trigger as a child to a node for which callbacks should be fired: select the Node Trigger in the World Hierarchy window and drag it inside the required node.

Editing a Node Trigger#

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

Node Trigger settings

The callback functions must be implemented in the world script (on UnigineScript side). The enabled and position callback functions should receive a Node Trigger that fires the callback as their 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 as argument.
Last update: 16.08.2019
Build: ()