1. Home
  2. Unity RTS Engine
  3. 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.

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.

Selection Group Settings:

  1. Enable Selection Groups: When enabled, then the player will be able to select multiple friendly units, press a number key and assign the selected units to that key. Each time the player presses that key, that unit group will be re-selected. Pressing the same key for another selected group of units will overwrite it and assign that key to the currently selected units.
  2. Group Assigned Audio: Audio clip played when a unit group is assigned.
  3. Group Empty Audio: Audio clip played when the player presses one of the number keys that is not assigned to a unit group.

How can we help?