Exemplo n.º 1
0
        void removeDeadUnitsFromSelections()
        {
            // units
            for (int i = 0; i < Unit.DeadUnits.Count;)
            {
                Unit unit = Unit.DeadUnits[i];

                SelectingUnits.Remove(unit);
                SelectedUnits.Remove(unit);
                selectedUnitsChanged = true;

                foreach (List <RtsObject> group in HotkeyGroups)
                {
                    group.Remove(unit);
                }

                Unit.DeadUnits.Remove(unit);
            }

            // structures
            for (int i = 0; i < Structure.DeadStructures.Count;)
            {
                Structure structure = Structure.DeadStructures[i];

                SelectingUnits.Remove(structure);
                SelectedUnits.Remove(structure);
                selectedUnitsChanged = true;

                foreach (List <RtsObject> group in HotkeyGroups)
                {
                    group.Remove(structure);
                }

                Structure.DeadStructures.Remove(structure);
            }
        }
Exemplo n.º 2
0
 private void DeselectUnit(Unit iUnit)
 {
     SelectedUnits.Remove(iUnit.gameObject);
     iUnit.Deselect();
     UpdateSelectedUnits();
 }
Exemplo n.º 3
0
 public void RemoveFromSelection(UnitSelection unitSelection)
 {
     unitSelection.Deselect();
     SelectedUnits.Remove(unitSelection);
 }