Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 public void RemoveSelectableUnit(UnitSelectable selUnit)
 {
     selectableUnits.Remove(selUnit);
 }
Esempio n. 3
0
    // 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>();
 }