Interface for a graph variable.
Variables are data containers that are accessible throughout a graph. You can manage variables in the Blackboard and reference them with variable nodes. A variable has a name, a data type, a kind that defines its visibility within subgraphs, and an optional default value. Use IVariable.TryGetDefaultValue to retrieve the default value if one exists. Variables are distinct from variable nodes. However, you can drag variables onto the graph canvas, where they are instantiated as variable nodes.
| Property | Description |
|---|---|
| DataType | Gets or sets the data type of the variable. |
| Graph | The IVariable.Graph that owns this variable. |
| IsConnected | Whether the variable has at least one connected variable node in the graph. |
| Name | Gets or sets the name of the variable. |
| NodeCount | The number of variable nodes associated with this variable in the graph. |
| VariableKind | Gets or sets the kind of the variable, such as Local, Input, or Output. |
| Method | Description |
|---|---|
| GetNodes | Retrieves all variable nodes associated with this variable. |
| RemoveFromGraph | Removes the current variable from its graph. |
| TryGetDefaultValue | Retrieves the default value of the variable. |
| TrySetDefaultValue | Sets the default value of the variable. |