Unit Selection
Guide on how to integrate Unit Selection with Unit System entities.
Overview
This page is for guiding you through the process of basic integration for Selection System package. Refer to the Selection Guide if you need more information.
1. Selection & Units
For scene unit selection to work, you only need these two things:
Selection System prefab in scene and configure it (and it's visuals)
SelectableUnitand additionallyManagedUnitObjectcomponents to your units.
Now this will already work for selecting and highlighting units by the player. However since this is a separate package, we need to connect selection and interaction for the player.

2. Sync Player Selection
If you are manually managing interactions and UI for selected units, you can skip this step.
However if you are using provided Player UI prefab, then EntitySelectionManager is used to communicate selection changes to those scripts. For this we have provided 2 basic scripts that simplify the integration process.
Find and add Player Selection (Unit Selection) prefab to your scene. This includes:
PlayerUnitSelectionManagerscript which replacesEntitySelectionManager. This manages the communication between theEntitySelectionManagerinterface andUnitSelectorto make sure the data is synced.Additionally we have 2 scripts for filtering selection, both may be removed if undesired:
MultiSelectionFilterscript for basic Strategy filtering behaviour, this restricts multi selection to only owned units of the player; when dragging to select multiple units, only owned ones are selected. Does not impact single selection behaviour.UnitStructureSelectionFilterscript, similar to the previous one it filters out units with buildable capabilities on multi-selection, but only when non-building is present. This means that drag to select can select buildings, as long as there is no other unit present in selection. Otherwise those units will be prioritised.

Player selection components
Last updated