Skip to content

StateUpdater

Inherits: Node

Update the state of a state machine when a signal fires

Description

The StateUpdater can be added as a child to any node that exposes signals. Upon entering the scene tree, the StateUpdater connects to a given signal on its parent, and will update the configured state machine's state to the given state, allowing menus to react to state changes (e.g. changing menus)

Properties

Type Name Default
StateMachine state_machine
String on_signal
State state
int action 0

Property Descriptions

state_machine

StateMachine state_machine

The state machine instance to use for managing state changes

on_signal

String on_signal

Signal on our parent to connect to. When this signal fires, the StateUpdater will change the state machine to the given state.

state

State state

The state to change to when the given signal is emitted.

action

int action = 0

Whether to push, pop, replace, or set the state when the signal has fired.