Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IStateOption

Interface for a state option.
Read time 1 minuteLast updated 10 days ago

Definition

public interface IStateOption

Remarks

State options are typed properties that appear in the graph inspector when a state is selected. They allow the tool developers to change the behavior of the state at edit time. Unlike the options of a Node, they are never drawn on the state in the state machine canvas.
Each option has a unique IStateOption.Name (which must be unique per state for identification), a IStateOption.DisplayName (for the UI), and a IStateOption.DataType that defines the type of its value. Use IStateOption.TryGetValue to retrieve the option's value.
See also:
Unity implements this interface. Do not implement it in your own types.

Properties

Property

Description

DataTypeThe data type of the state option.
DisplayNameThe display name of the state option shown in the UI.
NameThe unique identifier of the state option.
TooltipThe text displayed when hovering over the state option's display name.

Methods

Method

Description

TryGetValueTries to retrieve the value of the state option using the specified type.
TrySetValueSets a new value for the state option.