extends TextureButton @export var unit_resource: UnitResource func _ready(): tooltip_text = "Cost: " + str(unit_resource.cost) + "\n" + "Income: " + str(unit_resource.income) func _on_pressed() -> void: var unit = preload("res://Units/Unit.tscn").instantiate() as Unit unit.unit_resource = unit_resource Client.spawn_unit(unit, Client.current_stage.get_spawn(), Client.current_stage.get_overwrite_target())