π οΈAdd selection to scene
Step-by-step guide to add selection system to your scene
Video: You can also see the quick set up video here.
This package supports Unity's both new InputSystem
and the old Input
for player controls.
Steps to set up:
You can start by creating an empty Game Object and attach
UnitSelector
component to it or by dragging the SelectionSystem prefab into your scene, which is partially already configured for use. See Main tab and set up the following:Once Selection is in the scene, set the camera to your player's camera (
Camera.main
will be used if it's not set)Check out configuration options and adjust them for your project respectively
Set maximal selection number, if required.
Enable or disable quick access for units (saving and loading selection)
Next click on Selection Area tab and choose from one of the two provided selection area's or reference your custom one. For more details about them and their detection types see here Selection Area.
1st option: Selection Screen Rectangle for 2D screen space selection area.
2nd option: Selection World Cube for 3D world space selection area.
Here you have to set the Ground Layer Mask because the world selection needs ground position to start somewhere.
Now you can set up player interactions with the input on Input tab. Here you have support for:
None: requires manual management of selection active states, either directly on
UnitSelector
or by implementing your ownAInputControl
Legacy Input: uses built-in Unity input system
New InputSystem: utilises Unity latest and flexible input system (Package manager dependency)
Finally you can update any UI or notify your own components of selection events in the Events tab.
Save Scene.
In case your camera is spawned later or loaded with a different scene, you can always use set it up later once you have the reference to it. Like this:
Ok, You are now done with scene set up.
Last updated