IStateOption
Interface for a state option.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Interface
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
public interface IStateOption
Remarks
State options are typed properties that appear in the graph inspector when a state is selected. They allow the tool developers to change the behavior of the state at edit time. Unlike the options of a Node, they are never drawn on the state in the state machine canvas.
Each option has a unique IStateOption.Name (which must be unique per state for identification), a IStateOption.DisplayName (for the UI), and a IStateOption.DataType that defines the type of its value. Use IStateOption.TryGetValue to retrieve the option's value.
See also:
-
State.OnDefineOptions for how to declare the options of a state
-
IStateOptionBuilder for how to configure an option as it is declared
Unity implements this interface. Do not implement it in your own types.
Properties
Property | Description |
|---|---|
| DataType | The data type of the state option. |
| DisplayName | The display name of the state option shown in the UI. |
| Name | The unique identifier of the state option. |
| Tooltip | The text displayed when hovering over the state option's display name. |
Methods
Method | Description |
|---|---|
| TryGetValue | Tries to retrieve the value of the state option using the specified type. |
| TrySetValue | Sets a new value for the state option. |