Engine Functions
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
The Engine class is required for the engine initialization and executing the main loop of the program. Also, you can get the engine startup options through this class.
See Also#
Analogues of C++ runWorldFunction() methods are described in the engine.world class reference.
Analogues of C++ runEditorFunction() methods are described in the engine.editor class reference.
Analogues of C++ runSystemFunction() methods are described in the engine.system class reference.
Engine Class
Members
engine.getAppPath ( ) #
Returns the path to a directory where binary executable file is stored.Return value
Path to a directory where binary executable file is stored.engine.getArg ( int num ) #
Returns a command line argument by its index.Arguments
- int num - Index of the command line argument.
Return value
Command line argument.engine.getCachePath ( ) #
Returns a path to a directory where cached files will be stored.Return value
Path to the directory with cached files.ControlsApp engine.getControls ( ) #
Returns a ControlsApp object that handles input from the current application window.Return value
An instance of the ControlsApp class.engine.getDataPath ( ) #
Returns a path to the -data_pathdirectory specified at the engine startup.Return value
Path to the data directory.engine.getLibraryModulePath ( ) #
Returns a path to the Engine's dynamic library file.Return value
Path to the Engine's dynamic library file.engine.getEditorCache ( ) #
Returns a path to the editor script cache file.Return value
Path to the editor script cache.engine.getEditorScript ( ) #
Returns a path to the editor script (provided by the -editor_scriptcommand line argument).Return value
Path to the editor script.engine.getExternDefine ( ) #
Returns the external definitions specified on the application start-up.Return value
The list of external definitions.string engine.getFeatures ( ) #
Returns the list of features (like OpenGL, Direct3D, Microprofile, Geodetic, etc.).Return value
The list of features (like OpenGL, Direct3D, Microprofile, Geodetic, etc.).static engine.getVersion ( ) #
Returns the Engine version info.Return value
Engine version info.engine.getArg ( int num ) #
Returns the command-line argument by its index.Arguments
- int num - Index of the argument
Return value
Command-line argumentint engine.getNumPluginPaths ( ) #
Returns the number of paths to directories with plugins specified via -plugin_pathcommand-line option.Return value
Number of the specified paths to directories with plugins.int engine.getNumPlugins ( ) #
Returns the number of loaded plugins.Return value
Number of plugins.engine.getPluginPath ( int num ) #
Returns a path to a plugin directory specified via -plugin_path.Arguments
- int num - Plugin path number in the row of the specified plugin paths.
Return value
Path to a plugin directory.float engine.getPresentTime ( ) #
Returns the total time spent on waiting for the GPU after all calculations on the CPU are completed. See the Profiler article for details.Return value
Time value, in milliseconds.Engine::PRECISION engine.getPrecision ( ) #
Returns the Unigine Engine precision type.Return value
Precision type.float engine.getRenderTime ( ) #
Returns the time value, required to prepare all data to be rendered in the current frame and feed rendering commands from the CPU to the GPU. See the Profiler article for details.Return value
Rendering time value, milliseconds.engine.getSavePath ( ) #
Returns a path to a directory where a default configuration file, saved files and screenshots will be stored.Return value
Path to a directory with the default configuration file, saved files, etc.engine.getSoundApp ( ) #
Returns the current sound API.Return value
Sound API used.engine.getSystemCache ( ) #
Returns a path to the system script cache.Return value
Path to the system script cache.engine.getSystemScript ( ) #
Returns a path to the system script.Return value
Path to the system script.float engine.getTotalTime ( ) #
Returns the total time that both rendering and calculating of the frame took (the duration of the main loop in the application execution sequence). Includes update, render, swap and wait GPU.Return value
Total time value, milliseconds.float engine.getTotalCPUTime ( ) #
Returns the total CPU time taken to perform calculations for the frame (the duration of the main loop in the application execution sequence). Includes update, render and swap.Return value
Total CPU time value, milliseconds.float engine.getUpdateTime ( ) #
Returns the duration of the update phase, during which the objects are prepared for their collision response to be calculated.Return value
The update phase duration value, milliseconds.engine.getVideoApp ( ) #
Returns a graphics API used for rendering.Return value
Graphics API used for rendering.void engine.error ( string format, ... values ) #
Adds a text describing an error to the list of errors.Arguments
- string format - Format of the error text. See the formatting string description.
- ... values - Arguments, multiple allowed.
void engine.message ( string format, ... values ) #
Adds a new message to the list of messages.Arguments
- string format - Format of the message text. See the formatting string description.
- ... values - Arguments, multiple allowed.
Last update:
2022-03-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)