AddOption
Adds a new state option.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
AddOption(string, Type)
Adds a new state option.
IStateOptionBuilder AddOption(string name, Type dataType)
Parameters
Returns
Type | Description |
|---|---|
| IStateOptionBuilder | An IStateOptionBuilder to further configure the option. |
Remarks
nameExamples
protected override void OnDefineOptions(IOptionDefinitionContext context){ context.AddOption("MyOption", typeof(int)) .WithDefaultValue(2) .Delayed();}
AddOption<T>(string)
Adds a new state option.
IStateOptionBuilder<TData> AddOption<TData>(string name)
Parameters
The unique identifier of the option.
Returns
Type | Description |
|---|---|
| IStateOptionBuilder<T> | An IStateOptionBuilder to further configure the option. |
Remarks
nameExamples
protected override void OnDefineOptions(IOptionDefinitionContext context){ context.AddOption<int>("MyOption") .WithDefaultValue(2) .Delayed();}