feat: Debug set state animations (#495)

Co-authored-by: Balloonpopper <balloonpopper@git.com>
This commit is contained in:
balloonpopper
2022-02-16 04:24:08 +11:00
committed by GitHub
parent b39f5dc0fb
commit 5e0e83f23e

View File

@@ -45,9 +45,25 @@ func set_state(p_state: String, immediate: bool = false):
var actual_animator
if animation_node.has_animation(p_state):
if immediate:
escoria.logger.debug(
"State \"%s\" set. Matching immediate animation executing." % [
p_state
]
)
animation_node.seek_end(p_state)
else:
escoria.logger.debug(
"State \"%s\" set. Matching non-immediate animation executing." % [
p_state
]
)
animation_node.play(p_state)
else:
escoria.logger.debug(
"State \"%s\" set. No matching animation found." % [
p_state
]
)
# Set the active value, thus hiding or showing the object