This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Setting Up Properties
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
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
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии 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).
  • 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 Clutter objects.

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 Nodes 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.

Node Trigger settings

Setting Up Callbacks#

To add enabled/disabled or position callback, write a callback function that receives at least 1 argument of the NodeTrigger type. Then use use addEnabledCallback() / addPositionCallback() to specify the function to be called. See other methods of editing Node Trigger callbacks here.

Source code (C++)
// add the enabled and position callbacks
nodeTrigger->addEnabledCallback(MakeCallback(this, &enabled_callback));
nodeTrigger->addPositionCallback(MakeCallback(this, &position_callback));
Source code (C#)
// add the enabled and position callbacks
nodeTrigger.AddEnabledCallback(enabled_callback);
nodeTrigger.AddPositionCallback(position_callback);
Last update: 09.04.2021
Build: ()