IN THIS ARTICLE
Simple State Component
The Simple State component provides a simple state machine. Each state is represented by a name and an array of zero or more entities. The entities are activated upon entering the state and deactivated upon exiting it. A simple state component may be in
NullState, which means no state is active.
|Initial state||The active state when the Simple State component is first activated.|
|Reset on activate||If enabled, Simple State component returns to the Initial state when activated, and not the state held before deactivating.||Boolean|
|States||An array of states.|
|States - Name||Defines the name of the state.||String|
|States - Entities||An array of entities that are associated with a state.||EntityId||None|
|Returns the Name of the current state.||None||State: String||Yes|
|Returns the total number of states.||None||Count: Integer||Yes|
|Sets the component to a specific state by Name.||State: String||None||Yes|
|Sets the component to a specific state by its index in the States array.||State Index: Integer||None||Yes|
|Sets the component to State, the first state in the States array.||None||None||Yes|
|Sets the component to the last state in the States array.||None||None||Yes|
|Sets the component to the next state in the States array.||None||None||Yes|
|Sets the component to the previous state in the States array.||None||None||Yes|
|Notifies listeners that the state has changed.||None||Old State: String, New State: String||Yes|
For more information, see Working with the Event Bus (EBus) system .
Copyright © 2022 Open 3D Engine Contributors
Documentation Distributed under CC BY 4.0.
The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Policy page.