void Update() { if (!EventSystem.current.IsPointerOverGameObject()) { if (Input.GetMouseButtonDown(0)) { DoSelection(); } else if (selectedUnit || selectedPawn != null) { if (Input.GetMouseButtonDown(1)) { DoMove(); } else { DoPathfinding(); } } if (Input.GetKeyDown(KeyCode.Space)) { WorldTime.TogglePause(); } } }