Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetState(int)

Retrieves a state in the state machine by its index.
Read time 1 minuteLast updated 8 days ago

Definition

public IState GetState(int index)

Parameters

index

The zero-based index of the state to retrieve.

Returns

Type

Description

IStateThe IState at the specified index.

Remarks

Use this method to access a state based on its creation order in the state machine. The index is zero-based and must be within range (see: StateMachine.StateCount).