ft: nucleotide prey FSM
This commit is contained in:
@@ -10,7 +10,7 @@ class_name StateMachine extends Node
|
||||
# Connect states on ready, then wait.
|
||||
func _ready() -> void:
|
||||
for node: State in find_children("*", "State"):
|
||||
node.finished.connect(_transition_to_next_state)
|
||||
node.finished.connect(transition_to_next_state)
|
||||
|
||||
await owner.ready
|
||||
state.enter("")
|
||||
@@ -37,3 +37,6 @@ func _transition_to_next_state(target_path: String, data: Dictionary = {}) -> vo
|
||||
state.exit()
|
||||
state = get_node(target_path)
|
||||
state.enter(previous_state_path, data)
|
||||
|
||||
func transition_to_next_state(target: int, data: Dictionary = {}) -> void:
|
||||
push_error("Child FSM failed to implement transition function.")
|
||||
|
||||
Reference in New Issue
Block a user