From c8f674ac6fa0914d9e448d2929f2385cdad80d60 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 5 Nov 2024 11:34:49 +0100 Subject: next commit --- UI/spawn_button.gd | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'UI/spawn_button.gd') diff --git a/UI/spawn_button.gd b/UI/spawn_button.gd index ba67e37..a773406 100644 --- a/UI/spawn_button.gd +++ b/UI/spawn_button.gd @@ -2,6 +2,7 @@ extends TextureButton @export var texture: Texture2D +@export var sprite_sheet: SpriteFrames func _on_pressed() -> void: @@ -11,4 +12,7 @@ func _on_pressed() -> void: unit.get_node("Sprite2D").texture = texture unit.get_node("Sprite2D").scale = Vector2(32,32) / texture.get_size() + if sprite_sheet: + unit.get_node("AnimatedSprite2D").sprite_frames = sprite_sheet + Client.spawn_unit(unit, Client.current_stage.get_spawn(), Client.current_stage.get_overwrite_target()) -- cgit v1.2.3