Esempio n. 1
0
 private void DeselectAllUnits()
 {
     if (_selectedBuilding)
     {
         DeselectBuilding();
     }
     if (SelectedUnits.Count > 0)
     {
         SelectedUnits.RemoveAll(u => u == null);
         SelectedUnits.ForEach(delegate(GameObject unit) { unit.GetComponent <Unit>().Deselect(); });
         SelectedUnits.Clear();
         UpdateSelectedUnits();
     }
 }
Esempio n. 2
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /// <summary>
    //
    /// </summary>
    public void DeselectAllObjects()
    {
        // Set all objects to NOT selected
        foreach (var obj in SelectedWorldObjects)
        {
            obj.SetIsSelected(false);
        }
        foreach (var obj in SelectedUnits)
        {
            obj.SetIsSelected(false);
        }

        // Clear the list
        if (SelectedWorldObjects.Count > 0)
        {
            SelectedWorldObjects.Clear();
        }
        if (SelectedUnits.Count > 0)
        {
            SelectedUnits.Clear();
        }
    }
Esempio n. 3
0
 /// <summary>
 /// ONLY way to remove selection!
 /// </summary>
 public void ClearSelection()
 {
     SelectedUnits.ForEach(a => a.Deselect());
     SelectedUnits.Clear();
 }