LSQ Class
LSQ allows to set or get values easily from the global scene, using short strings as identifiers similar to jQuery and the DOM: LSQ("nod_name").material = ...
Item Index
Methods
Methods
get
-
locator
Retrieves the value of a property of one node in the scene, just by using a string identifier Example: var value = LSQ.get("mynode|a_child/MeshRenderer/enabled");
Parameters:
-
locator
Stringthe locator string identifying the property
Returns:
value of the property
set
-
locator
-
value
Assigns a value to a property of one node in the scene, just by using a string identifier Example: LSQ.set("mynode|a_child/MeshRenderer/enabled",false);
Parameters:
-
locator
Stringthe locator string identifying the property
-
value
value to assign to property
setFromInfo
-
info
-
value
Assigns a value using the getLocatorInfo object instead of searching it again This is faster but if the locator points to a different object it wont work.
Parameters:
-
info
Objectinformation of a location (obtain using scene.getLocatorInfo
-
value
to assign
shortify
-
locator
Shortens a locator that uses unique identifiers to a simpler one, but be careful, because it uses names instead of UIDs it could point to the wrong property Example: "@NODE--a40661-1e8a33-1f05e42-56/@COMP--a40661-1e8a34-1209e28-57/size" -> "node|child/Collider/size"
Parameters:
-
locator
Stringthe locator string to shortify
Returns:
the locator using names instead of UIDs