OnDefineSubgraphStateOptions(IOptionDefinitionContext)
Called to define the IStateOption s available on subgraph states that reference this type of state machine. Similar in function to State.OnDefineOptions.
Read time 1 minuteLast updated 14 days ago
Definition
- Type: Method
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
protected virtual void OnDefineSubgraphStateOptions(State.IOptionDefinitionContext context)
Parameters
Provides methods for defining state options.
Remarks
Override this method to add options to all ISubgraphStates that point to this type of state machine using the provided State.IOptionDefinitionContext. This method is only applicable when the state machine is referenced by a subgraph state, in a state machine that supports subgraphs through StateMachineOptions.SupportsSubgraphs. Like the options of a State, the options of a subgraph state only appear in the graph inspector when the subgraph state is selected.
Examples
protected override void OnDefineSubgraphStateOptions(State.IOptionDefinitionContext context){ context.AddOption<int>("ID") .WithTooltip("The ID of the subgraph.") .Delayed(); context.AddOption<string>("Description") .WithDefaultValue("What is the purpose of this subgraph?") .Delayed();}