Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

State

class in Unity.GraphToolkit.Editor


Implements interfaces:IState

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

The base class for all user-accessible states in a State.StateMachine.

Inherit from this class to define custom state types that appear in a state machine graph. A state represents a node in a State.StateMachine; transitions connect states to one another. Unlike Node, a state does not expose configurable input and output ports: its incoming and outgoing transition connections are managed by the state machine itself.

See also:

  • State.StateMachine for the graph type that contains states
  • Node for the equivalent base class used in regular graphs
  • IState for the interface this class implements

Properties

Property Description
DefaultColor The highlight color of the state. The highlight is located on the upper border of the state.
ID The globally unique identifier for this state.
IsConnected Whether the state is connected to at least one transition.
Position The position of the state in the state machine.
StateMachine The State.StateMachine that contains this state.
Subtitle The secondary text displayed in the state's header.
Title The main text displayed in the state's header.
Tooltip The text displayed when hovering over the state's header.

Public Methods

Method Description
GetIncomingTransitions Retrieves the transitions that go to this state.
GetOutgoingTransitions Retrieves the transitions that originate from this state.
OnDisable Called when the state is removed or when the state machine is disabled.
OnEnable Called when the state is created or when the state machine is enabled.
RemoveFromStateMachine Removes the state from its state machine.