14 lines
366 B
GDScript
14 lines
366 B
GDScript
extends Button
|
|
class_name TowerButton
|
|
|
|
@export var towerType : Tower.TYPES
|
|
|
|
func _init() -> void:
|
|
#font_outline_color = Color.YELLOW
|
|
EventBus.energy_has_changed.connect(changeEnergy)
|
|
pressed.connect(func(): EventBus.tower_selected.emit(towerType))
|
|
|
|
|
|
func changeEnergy(tower : Tower) -> void:
|
|
if tower.tower_type == towerType:
|
|
$ProgressBar.value = tower.energy
|