UnitResource - stingray.UnitResource namespace reference - Stingray Lua API Reference
Contains functions that operate on unit resources.
These functions can be used to extract information from unit resources without
having to spawn the unit into the world. The unit resources must be loaded
prior to calling these functions.
|
get_data ( unit_resource_name, indices ) : any
Retrieves the data set at the specified indices within the unit's script data object from the unit resource.
|
Parameters unit_resource_name : | string | The name of the unit resource. |
indices : | any(integer, string)+ | One or more indices for the data, which may be integers or strings. The + notation indicates that there may be one or more instances of the specified type. The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses. |
Returns any |
The value previously set at the specified sequence of indices.
|
|
has_data ( unit_resource_name, indices ) : boolean
Indicates whether or not any data has been saved at the specified indices in the unit resource script data object.
|
Parameters unit_resource_name : | string | The name of the unit resource. |
indices : | any(integer, string)+ | One or more indices for the data, which may be integers or strings. The + notation indicates that there may be one or more instances of the specified type. The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses. |
Returns boolean |
Returns true if a data value is stored at the specified sequence of indices, or false otherwise.
|