public void OnBeginDrag(PointerEventData eventData) { if (!Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift)) { UnitSelectable.DeselectAll(new BaseEventData(EventSystem.current)); } selectionBoxImage.gameObject.SetActive(true); startPosition = eventData.position; selectionRect = new Rect(); }
public void RemoveSelectableUnit(UnitSelectable selUnit) { selectableUnits.Remove(selUnit); }
// SELECTABLE UNITS //////////////////////////////////////////////////////////////////////////////// // Add unit to the list of selectable units for this commander public void AddSelectableUnit(UnitSelectable selUnit) { selectableUnits.Add(selUnit); }
void Awake() { navMeshAgent = GetComponent <NavMeshAgent>(); unitSelectable = GetComponent <UnitSelectable>(); }