This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

engine.properties Functions

This set of functions control the loading and managing of properties libraries.

int engine.properties.addWorldLibrary (string filename)

Loads a library and associates it with the current world. If the library file does not exist, an empty library is created.

Arguments

  • string filename - File with the library to load.

Return value

1 if the library is loaded or created successfully; otherwise, 0.

int engine.properties.clear (string library)

Removes a given library and all its contents from a list of property libraries not belonging to the current world. Note that you cannot delete a library, if some of its properties are parent to properties from other libraries.

Arguments

  • string library - Name of the library.

Return value

1 if the library is removed successfully; otherwise, 0.

int engine.properties.cloneProperty (string name, string dest_library, string dest_name)

Copies a property to another library.

Arguments

  • string name - Name of the property to copy.
  • string dest_library - Destination library, into which the property will be copied.
  • string dest_name - Name, under which the property will be added to the destination library.

Return value

1 if the property is cloned successfully; otherwise, 0.

int engine.properties.create (string name)

Creates an empty property library.

Arguments

  • string name - Property library name.

Return value

Returns 1 if the library is created successfully; otherwise, 0.

int engine.properties.findLibraryProperty (int library, string name)

Searches for a specific property in a given library.

Arguments

  • int library - Library, in which to search for the property.
  • string name - Name of the property.

Return value

Index of the property in the library, if found; otherwise, -1.

int engine.properties.findLibrary (string name)

Searches for a library by name.

Arguments

  • string name - Name of the library.

Return value

Index of the library if found; otherwise, -1.

int engine.properties.findPropertyLibrary (string name)

Searches for a library containing a given property.

Arguments

  • string name - Name of the property.

Return value

Index of the library, if found; otherwise, -1.

Property engine.properties.findProperty (string name)

Searches for a property with a given name.

Arguments

  • string name - Name of the property.

Return value

Property, if found; otherwise, 0.

string engine.properties.getLibraryName (int index)

Returns the name of a library by its index.

Arguments

  • int index - Index of the library.

Return value

Name of the library.

int engine.properties.getNumLibraries ()

Returns the number of all property libraries not belonging to the current world (for example, loaded by other worlds or with the engine.properties.load() function).

Return value

Number of property libraries not belonging to the world.

int engine.properties.getNumProperties (int index)

Returns the number of properties in a given library.

Arguments

  • int index - Index of the library.

Return value

Number of properties in the library.

int engine.properties.getNumWorldLibraries ()

Returns the number of property libraries belonging to the current world.

Return value

Number of libraries belonging to the world.

string engine.properties.getPropertyName (int library, int num)

Returns the name of a property by its index in a given library.

Arguments

  • int library - Index of the library.
  • int num - Index of the property.

Return value

Name of the property.

Property engine.properties.getProperty (int library, int num)

Returns a property by its index in a given library.

Arguments

  • int library - Index of the library.
  • int num - Index of the property.

Return value

The property.

string engine.properties.getWorldLibraryName (int index)

Returns the name of a library belonging to the current world by its index.

Arguments

  • int index - Index of the library.

Return value

Name of the library.

int engine.properties.inheritProperty (string name, string dest_library, string new_name)

Creates a new property that inherits from a given one and adds it to a specified library.

Arguments

  • string name - Name of the property to inherit from.
  • string dest_library - Destination library, into which the inherited property will be added.
  • string new_name - Name, under which the inherited property will be added to the destination library.

Return value

1 if the property is inherited successfully; otherwise, 0.

int engine.properties.isLibraryEditable (int index)

Returns a value indicating if properties can be added to or removed from a given library.

Arguments

  • int index - Index of the library.

Return value

1 if the library is editable; otherwise, 0.

int engine.properties.isLibrary (string name)

Checks if there is a library with a given name.

Arguments

  • string name - Name of the library.

Return value

1 if the library exists; otherwise, 0.

int engine.properties.isProperty (string name)

Checks if there is a property with a given name.

Arguments

  • string name - Name of the property.

Return value

1 if the property exists; otherwise, 0.

int engine.properties.load (string filename)

Loads a library from a given file.

Arguments

  • string filename - File with the library to load.

Return value

1 if the library is loaded successfully; otherwise, 0.

int engine.properties.moveProperty (string name, string dest_library, string dest_name)

Moves a property to another library.

Arguments

  • string name - Name of the property to move.
  • string dest_library - Destination library, into which the property will be moved.
  • string dest_name - Name, under which the property will be added to the destination library.

Return value

1 if the property is moved successfully; otherwise, 0.

int engine.properties.removeProperty (string name)

Completely removes a property and all its children.

Arguments

  • string name - Name of the property to remove.

Return value

1 if the property is removed successfully; otherwise, 0.

int engine.properties.removeWorldLibrary (string name)

Removes a world library and all its contents.

Arguments

  • string name - Name of the library to remove.

Return value

1 if the library is removed successfully; otherwise, 0.

int engine.properties.save (string name)

Saves a library on disk. The name of a file, into which the library will be saved, is the same as the name of the library.

Arguments

  • string name - Name of the library to save.

Return value

1 if the library is saved successfully; otherwise, 0.
Last update: 2017-07-03
Build: ()