Skip to content

Commit

Permalink
feat: Debug set state animations (#495)
Browse files Browse the repository at this point in the history
Co-authored-by: Balloonpopper <[email protected]>
  • Loading branch information
balloonpopper and Balloonpopper authored Feb 15, 2022
1 parent b39f5dc commit 5e0e83f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions addons/escoria-core/game/core-scripts/esc/types/esc_object.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e0e83f

Please sign in to comment.