class_name ItemInteractable extends Item @onready var interaction_area: InteractionArea = $InteractionArea @onready var animation_player: AnimationPlayer = $AnimationPlayer #func _ready() -> void: #state_changed.connect(Callable(self, "_on_state_changed")) #interaction_area.interact = Callable(self, "_on_interact") #func _on_interact() -> void: #match state: #States.closed: #state = States.opened #interaction_area.action_name = "open" #States.opened: #state = States.closed #interaction_area.action_name = "close" # #func _on_state_changed(new_state: States) -> void: #match new_state: #States.opened: #animation_player.play("open") #States.closed: #animation_player.play("close")