states_stack_displayer.gd 343 B

1234567891011121314
  1. extends Panel
  2. @onready var fsm_node = get_node(^"../../Player/StateMachine")
  3. func _process(_delta):
  4. var states_names = ""
  5. var numbers = ""
  6. var index = 0
  7. for state in fsm_node.states_stack:
  8. states_names += String(state.get_name()) + "\n"
  9. numbers += str(index) + "\n"
  10. index += 1
  11. %States.text = states_names
  12. %Numbers.text = numbers