Added a function to get a state by name
This commit is contained in:
parent
ac112b78d6
commit
6ba0b62dd9
@ -25,6 +25,9 @@ func _process(delta):
|
|||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
CURRENT_STATE.physics_update(delta)
|
CURRENT_STATE.physics_update(delta)
|
||||||
|
|
||||||
|
func get_state(state_name: StringName) -> State:
|
||||||
|
return states.get(state_name)
|
||||||
|
|
||||||
func on_child_transition(new_state_name: StringName) -> void:
|
func on_child_transition(new_state_name: StringName) -> void:
|
||||||
var new_state = states.get(new_state_name)
|
var new_state = states.get(new_state_name)
|
||||||
if new_state != null:
|
if new_state != null:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user