beta-1.1
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
extends Node
|
||||
class_name PlayerStateMachine
|
||||
|
||||
signal StateChanged
|
||||
|
||||
enum States {
|
||||
UNSET, IDLE, WALKING, USING_ITEM_A, DRAWING_BOW, FIRING_ARROW,
|
||||
SITTING, CUTSCENE
|
||||
SITTING, CUTSCENE, PLAY_ANIMATION
|
||||
}
|
||||
|
||||
@export var states_container: Node
|
||||
@@ -36,7 +38,6 @@ func _ready() -> void:
|
||||
current_state.Enter({})
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if current_state:
|
||||
current_state.Update(delta)
|
||||
@@ -53,3 +54,5 @@ func _swap_state() -> void:
|
||||
current_state.Enter(queued_parameters)
|
||||
queued_state = PlayerStateMachine.States.UNSET
|
||||
queued_parameters = {}
|
||||
|
||||
StateChanged.emit()
|
||||
|
||||
Reference in New Issue
Block a user