summaryrefslogtreecommitdiff
path: root/UI/spawn_button.gd
diff options
context:
space:
mode:
Diffstat (limited to 'UI/spawn_button.gd')
-rw-r--r--UI/spawn_button.gd4
1 files changed, 4 insertions, 0 deletions
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())