Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IState

Interface for a state in a IState.StateMachine.
Read time 1 minuteLast updated 7 days ago

Definition

public interface IState

Remarks

A state is the state machine equivalent of an INode. Unlike a node, a state does not expose configurable input and output ports: its incoming and outgoing connections are transitions managed by the state machine itself.
See also:
  • State for the base class used to define custom states
  • ISubgraphState for how to work with subgraph-based states
Unity implements this interface. Do not implement it in your own types.

Properties

Property

Description

DefaultColorThe highlight color of the state. The highlight is located on the upper border of the state.
FillAmountThe progress fill amount displayed on the state's accent bar, expressed as a percentage.
IDThe globally unique identifier for this state.
IsConnectedWhether the state is connected to at least one transition.
OptionCountThe number of options defined in the state.
OptionsThe options defined on this state.
PositionThe position of the state in the state machine.
StateMachineThe IState.StateMachine that contains this state.
SubtitleThe secondary text displayed in the state's header.
TitleThe main text displayed in the state's header.
TooltipThe text displayed when hovering over the state's header.

Methods

Method

Description

GetIncomingTransitionsRetrieves the transitions that go to this state.
GetOptionRetrieves a state option using its zero-based index.
GetOptionByNameRetrieves a state option using its name.
GetOutgoingTransitionsRetrieves the transitions that originate from this state.
RemoveFromStateMachineRemoves the state from its state machine.