blob: 1d2dd9f89d1cc1bd164a9ff563f0455cc3738f42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
class_name StateDefault
extends State
func _state_input(event: InputEvent) -> void:
if event.is_action_pressed("build_mode_start"):
set_state("StateBuild")
# deselect
if event.is_action_pressed("select"):
# if not multi selecting
if not event.is_double_click() and not Input.is_action_pressed("select_multiple"):
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
|