OnDefineOptions(IOptionDefinitionContext)
Called during State.DefineState to define the options available on the state.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
protected virtual void OnDefineOptions(State.IOptionDefinitionContext context)
Parameters
Provides methods for defining state options.
Remarks
Override this method to add options using the provided State.IOptionDefinitionContext. The options of a state only appear in the graph inspector when the state is selected: they are never drawn on the state in the state machine view.
Examples
protected override void OnDefineOptions(IOptionDefinitionContext context){ context.AddOption<float>("speed") .WithDisplayName("Speed") .WithTooltip("The speed at which the state runs.") .WithDefaultValue(1.0f);}