References Overview |
The support of reference values for properties is a fundamental feature of NeoAxis Engine. Technically, references allows you to get the property value of other properties, methods, scripts or other sources. References are allowed to link to objects inside the resource and link to other resources.
Reference can point to an object. A typical example of reference usage is how mesh geometry points to the material.
Reference can point to a method. For example, it is used during scripting. A method returning a value is created. If some property reference this method, its value will be obtained from the method result.
Script code:
Reference can point to a property of another object. In this case, the value of the property will duplicate the value of the referenced object's property. This allows to come up with many creative solutions. For example, one can create a shared property, which could be referenced by other objects. In this case, it would be enough to change the property in a single place, and the rest of the objects will be updated automatically.
Also, one can extract shared Property to a separate resource. One can think of it as a configuration file.