Base abstract class for the Return Node in ReturnGraph, and is converted to a ReturnRuntimeNode<T> for runtime use. Inherits from IReturnNode. The ReturnNode holds a reference to a value, which becomes the output value of the graph when evaluated.
When creating a new ReturnGraph, this is the only class that requires a custom implementation for the graph to work. For the ReturnNode to appear in your graph, a custom ReturnNode class must be created inheriting from the generic version of ReturnNode. The generic parameter must be of type Scriptable Object.
IMPORTANT: your custom ReturnNode must have the [Serializable] and [UseWithGraph(typeof(ReturnGraph))] attributes.
See How To Use ReturnGraph for more information on how to create a custom ReturnNode.
| Method | Description |
|---|---|
| OnDefinePorts | Defines the input ports for the node in the provided port definition context. Return nodes have only one Input port and no Output ports. |
| OnDefineOptions | Defines the options for the node using the provided option definition context. Return nodes have one option for their return value. The type of the option is determined by extending the generic version of the ReturnNode class. |
| BuildRuntimeNode | Returns a ReturnRuntimeNode<T> containing the ReturnNode's return value. |
| HasValidReturnValue | Determines whether the return node has a valid return value associated with it. |
public class SampleScriptableObject : ScriptableObject { }
[Serializable]
[UseWithGraph(typeof(ReturnGraph))]
internal class SampleReturnNode : ReturnNode<SampleScriptableObject>
{
// ReturnNode will have an option of type SampleScriptableObject
// Will be converted at runtime to a ReturnRuntimeNode<SampleScriptableObject>
}

A custom ReturnNode that returns a value of SampleScriptableObject.