@tool extends InspectableEntity class_name WinCristal @export_tool_button("Update", "Callable") var update_action = update @export_tool_button("Spawn Anim", "Callable") var spawn_action = spawn_animation @export var data : WinCristalData = WinCristalData.random() : set(v): data = v update() func _ready(): update() func update(): if is_node_ready() and data: for i in range(len(%Sprites.get_children())): %Sprites.get_children()[i].visible = data.cristal_type == i %Sprites.get_children()[i].flip_h = data.cristal_flip func spawn_animation(): scale = Vector2.ZERO %CristalPlayer.play() get_tree().create_tween().tween_property(self, "scale", Vector2.ONE, 0.3).set_trans(Tween.TRANS_BOUNCE) func get_card_up_padding() -> float: return Pointer.CARD_UP_PADDING * 2 func save() -> EntityData: data.position = global_position return data