ドキュメント

Unity Engine

Unity Engine

GetOptionByName(string)

Retrieves a state option using its name.
読み終わるまでの所要時間 1 分最終更新 2ヶ月前

Definition

public IStateOption GetOptionByName(string name)

Parameters

name

The unique name of the option.

Returns

Type

Description

IStateOptionThe option with the specified name, or null if none is found.

Remarks

The option's name is unique within the state's options.

Examples

if (myState.GetOptionByName("speed") is { } speed && speed.TryGetValue<float>(out var value)) Debug.Log(value);