Reflected Nodes

IMPORTANT! - The reflection feature is only available in the Professional and Personal Learning Edition (PLE) versions of uScript. If you wish to upgrade your license of uScript Basic to the Professional version, please purchase an upgrade on the Unity Asset Store.

 

One of uScript's most powerful features, node reflection, allows uScript to visually represent many parts of your game visually without the need to write custom nodes to access them. More advanced uScript graphs will almost always use at least some reflected nodes.

 

By default uScript will reflect, as visual nodes, any components or scripts that have been assigned to GameObjects in your Unity scene that contain public methods, properties, or variables.

 

Also see "Advanced Reflection" in the Advanced uScript Topics section for more information about reflection.

 

 

Rules of Reflection

It is important to remember the rules uScript uses to determine what it reflects as visual nodes inside the editor:

 

 

 

Locating Reflected Nodes

All nodes that are being reflected by uScript can be found in the Reflected ( ) section of the uScript Editor's Toolbox panel.

 

 

 

The empty braces will contain the name of the currently open Unity scene if you have one open. In this example, we have a Unity scene open in the editor called "MySceneName".

 

 

The scene is important because as noted above, uScript can only reflect what is available in a specific Unity scene. As an example, if you have a Unity scene open that has a light GameObject in your scene, you will have access to reflected light properties-- but if you do not have any light GameObjects in your open scene, you won't see any light properties being reflected.

 

A Unity scene with no lights in it:

 

 

The same Unity Scene once a Point Light GameObject has been added:

 

 

Note! - You will need to close and re-open the uScript editor for it to detect and refresh what is being reflected by the Unity scene.

 

You can force uScript to reflect Unity functionality that is not present in the open Unity scene. This can be handy to access GameObject component properties for things that are only spawned at runtime. To learn more about this, please see the Reflecting Things That Aren't There section of "Advanced Reflection".

 

 

Instance Property

Almost all reflected nodes will have an Instance property that must be assigned to a GameObject in order for the reflected node to work. This is because you can easily have more than one instance of something in a Unity scene and uScript needs to know which specific instance you wish to target.


For example, you may have hundreds of Point Lights in your scene, so if you want to tell Unity to turn off a specific light by setting its Intensity property to zero, you will need to let uScript know exactly which one. This is done by assigning the Instance property of the reflected node:

 

 

Note! - If you wish to assign an instance at runtime in your graph, you can expose the Instance socket. Here is an example of doing this on a reflected Property node:

 

 

 

Note! - When you assign an Instance to a reflected Property node with a GameObject from your Unity scene, the generic name within the braces will change to the name of that GameObject (this will not happen when exposing the socket and assigning the GameObject instance externally as show above):