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