private void Update() { if (Input.GetMouseButtonDown(0)) { SelectedUnit = Selection(); } if (Input.GetMouseButtonDown(1) && SelectedUnit != null) { UnitGroup possibleTarget = Selection(); if (possibleTarget != null) { SelectedUnit.AttackGroup(possibleTarget); } else { Vector3 targetPosition = GetPoint(); if (targetPosition != new Vector3(-1, -1, -1)) { SelectedUnit.MoveGroup(targetPosition); } } } if (Input.GetKeyDown("e")) { UnitManager.instance.GetUnitGroup(GetPoint(), Quaternion.identity, 50, 10, 1.5f); } if (Input.GetKeyDown("1") && SelectedUnit != null) { SelectedUnit.ChangeTeam(); } }