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.

Custom Component System

Notice
This feature is an experimental one.

Component System enables you to implement your application’s logic via a set of building blocks - components, and assign these blocks to nodes. A logic component integrates a node, a property and a C++ class containing logic implementation.

The basic workflow is as follows:

  1. Inherit a new C++ class representing your component from the ComponentBase Class.
  2. In the header file determine and declare the list of parameters to be used by this component. All of these parameters with their default values (if specified) will be stored in a dedicated property file.
  3. Implement component logic inside the certain functions (init(),update(),render(), etc.), that will be called by the corresponding functions of the Engine's main loop.
  4. Register the component in the Component system.
  5. Assign the created property to a node to give it the desired functionality.

Each time a property registered in the Component System is assigned to a node, an instance of the corresponding component is created. This instance will be deleted when the corresponding property is replaced with another one or removed from the node’s list, or when the node is deleted.

The logic of a certain component is active only when the corresponding node and property are enabled. Thus, you can enable/disable logic of each particular component at run time when necessary.

You can assign several properties corresponding to different components to a single node. The sequence in which the logic of components is executed is determined by the order of corresponding properties in the list.

Notice
Components are assigned to nodes by property name (so beware not to create user properties having the same name as the component's property).

You can also create components for existing properties.

Components can interact with other components and nodes.

The Custom Component System is extendable and can be easily modified to add the desired functionality if necessary.

See Also

Last update: 26.04.2018
Build: ()