ドキュメント

Unity Engine

Unity Engine

AddOption

Adds a new node option.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

AddOption(string, Type)

Adds a new node option.
IOptionBuilder AddOption(string name, Type dataType)

Parameters

name

The unique identifier of the option.

dataType

The data type of the option.

Returns

Type

Description

IOptionBuilderAn IOptionBuilder to further configure the option.

Remarks

name
is used to identify the option. It must be unique among ports and options on the node. This name is used as the ID when calling Node.GetNodeOptionByName. If IOptionBuilder.WithDisplayName is not used, this name is also used as the option's display label.

Examples

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

name

The unique identifier of the option.

Returns

Type

Description

IOptionBuilder<T>An IOptionBuilder to further configure the option.

Remarks

name
is used to identify the option. It must be unique among ports and options on the node. This name is used as the ID when calling Node.GetNodeOptionByName. If IOptionBuilder<TData>.WithDisplayName is not used, this name is also used as the option's display label.

Examples

protected override void OnDefineOptions(IOptionDefinitionContext context){ context.AddOption<int>("MyOption") .WithDefaultValue(2) .Delayed()}