diff options
Diffstat (limited to 'Game/States/Default')
-rw-r--r-- | Game/States/Default/StateDefault.gd | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Game/States/Default/StateDefault.gd b/Game/States/Default/StateDefault.gd index 1d2dd9f..b7b630c 100644 --- a/Game/States/Default/StateDefault.gd +++ b/Game/States/Default/StateDefault.gd @@ -6,6 +6,12 @@ func _state_input(event: InputEvent) -> void: if event.is_action_pressed("build_mode_start"): set_state("StateBuild") + if event.is_action_pressed("select"): + if Unit.selected_unit: + Unit.selected_unit.is_selected = false + + +func _state_unhandled_input(event: InputEvent) -> void: # deselect if event.is_action_pressed("select"): # if not multi selecting @@ -13,7 +19,3 @@ func _state_input(event: InputEvent) -> void: if Tower.selected_towers: for tower in Tower.selected_towers.duplicate(): tower.is_selected = false - - if event.is_action_pressed("select"): - if Unit.selected_unit: - Unit.selected_unit.is_selected = false |