Description

A component responsible for managing and evaluating a RuntimeReturnGraph. The ReturnGraphDirector displays the RgBlackboardVariable<T>s associated with the referenced graph and draws fields for each, using a ReturnGraphDirectorEditor custom editor script.

The ReturnGraphDirector components allows you to set blackboard variables in the inspector, or modify them at runtime by accessing the director’s RgBlackboard through code.

Properties

Property Description
Graph The RuntimeReturnGraph this component evaluates
Blackboard The RgBlackboard containing variables used as parameters for the associated RuntimeReturnGraph

Methods

Method Description
OnEnable Unity lifecycle event called whenever an Object becomes enabled and active. Loads the Blackboard.
OnValidate Unity editor-only lifecycle event called whenever the script is loaded or a value changes in the inspector. Loads the Blackboard.
EvaluateGraph<T> Evaluates the associated RuntimeReturnGraph using the associated RgBlackboard and returns the result as a ScriptableObject of the specified type.
LoadBlackboard Initializes and synchronizes the RgBlackboard with the variables required by the associated RuntimeReturnGraph. This method ensures the blackboard contains all variables specified in the graph's configuration and preserves any values previously declared in the inspector if its variable persists.

Static Methods

Section Description
CreateBlackboardVariable Creates a new instance of a RgBlackboardVariable<T> of the specified type and assigns it a name.

A ReturnGraphDirector component with no RuntimeReturnGraph. Since no graph is present, the blackboard is not drawn, thanks to the ReturnGraphDirectorEditor custom editor script.

A ReturnGraphDirector component with no RuntimeReturnGraph. Since no graph is present, the blackboard is not drawn, thanks to the ReturnGraphDirectorEditor custom editor script.

A ReturnGraphDirector component with a referenced RuntimeReturnGraph. Since a graph is present, the blackboard is drawn. This graph requires 4 variables: a float, two booleans, and a GameObject. These values can be assigned in the inspector, or modified at runtime by accessing the director’s blackboard through code.

A ReturnGraphDirector component with a referenced RuntimeReturnGraph. Since a graph is present, the blackboard is drawn. This graph requires 4 variables: a float, two booleans, and a GameObject. These values can be assigned in the inspector, or modified at runtime by accessing the director’s blackboard through code.