Exemple #1
0
        /// <summary>
        /// Tentatively selects all selectable units inside the specified bounds.
        /// </summary>
        /// <param name="bounds">The bounds.</param>
        /// <param name="append">if set to <c>true</c> the selection will append to the current selection.</param>
        public void SelectUnitsAsPendingIn(PolygonXZ bounds, bool append)
        {
            int count = _selectableUnits.count;

            for (int i = 0; i < count; i++)
            {
                var  unit          = _selectableUnits[i];
                bool selectPending = (append && unit.isSelected) || bounds.Contains(unit.position);
                unit.MarkSelectPending(selectPending);
            }
        }
Exemple #2
0
        /// <summary>
        /// Selects all selectable units inside the specified bounds.
        /// </summary>
        /// <param name="bounds">The bounds.</param>
        /// <param name="append">if set to <c>true</c> the selection will append to the current selection.</param>
        public void SelectUnitsIn(PolygonXZ bounds, bool append)
        {
            var selected = _selectableUnits.Where(u => bounds.Contains(u.position));

            Select(append, selected);
        }