Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Selection Manager
  4. Selection Manager

Selection Manager

The Selection Manager component handles simple & multiple selection.

When you’re creating a new map using the RTS Engine menu editor, this component is attached to an object called “SelectionManager”.


General Selection Settings:

  1. Raycast Layer Mask: What layers does the selection manager consider? It is recommended to have the same layer mask as in the demo scene.
  2. Unit Selection Texture: Texture that will be used in the unit’s texture plane material.
  3. Building Selection Texture: Texture that will be used in the building’s texture plane material.
  4. Resource Selection Texture: Texture that will be used in this resource’s texture plane material.
  5. Multiple Selection Key: Holding this key down and selecting single units will add them to the selected units list.
  6. Double Click Select Size: When double clicking with the left mouse button on a friendly unit, all units with the same type inside the range that is defined by this field will be selected.
  7. Select Idle Workers Only: A UI button can trigger the selection of the player’s faction idle units by triggering the “SelectIdleUnits” method of the SelectionManager class when clicked. This field defines whether that method should select idle workers only (units that have the Builder and/or Resource Collector components) or not.

Selection Box Settings:

  1. Selection Box: a UI Image, child object of the Selection Box Canvas (not the Main Canvas). This represents the square that gets drawn when the player clicks and drags the mouse in the screen to select multiple units.
  2. Canvas: Drag and drop the main canvas to this field.
  3. Min Box Size: The minimum selection box size to show it on screen.

Selection Flash Settings:

When commanding units to attack a unit/building or when asking a villager to collect from a resource, the selection texture of the unit/building to attack or the resource to collect from will flash. The following settings concern that flash:

  1. Flash Time: For how long will the selection texture flash for?
  2. Friendly Flash Color: If the object that holds the selection texture is friendly to the local player’s faction then it will have this color while flashing.
  3. Enemy Flash Color: If the object that holds the selection texture belongs to an enemy faction then it will have this color while flashing.
  4. Flash Repeat Time: The flashing cycle of the selection texture.

How can we help?