This page has been translated automatically.
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
Usage Examples
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
This version of documentation is OUTDATED! Please switch to the latest one.

LogicModules Class

The LogicModule class provides an ability to dynamically compile the custom code.

The class implementation can be found in the data/framework/game/logic_module.h

LogicModules Class


LogicModules (string namespace_name)

Constructor. Creates a new LogicModule class instance in the specified namespace.


  • string namespace_name - Name of the namespace where the custom code is compiled.

string getNamespace ()

Returns a name of the namespace where the custom code is implemented

Return value

Name of the namespace.

void addModule (string file_name)

Adds a logic file to compile.


  • string file_name - Path to the logic file.

void clearModules ()

Clears list of files, which was added to compile.

void compile ()

Compiles logic.

int isCompiled ()

Checks if the logic is compiled successfully.

Return value

1 if the logic is compiled successfully; otherwise 0.

variable create (string type)

Creates a user class instance if this class is described in the custom logic.


  • string type - Type of the class instance.

Return value

User class instance.

void clear ()

Clears the compiled logic.
Last update: 2017-07-03
Build: ()