β¬Selection Area
Read more about how selection areas work
Overview
The selection area is a component responsible for presenting visuals for selection and for detecting any units within its area.
The abstract class ASelectionArea facilitates communication between the UnitSelector and various types of selection areas. This design allows for flexibility in the type of selection area you can implement, supporting a range of both existing and potentially new, user-defined areas.
Supported Selection Areas:
2D Screen Space Rectangle: Fully supported, ideal for straightforward rectangular selection interfaces.
3D World Space Cube: Fully implemented, allowing for cubic selection volumes in the game world.
Currently Unsupported (But Possible):
3D World Space Sphere: While not supported out of the box, this type of selection could also be implemented without a lot of effort, taking any existing implementation as a guide.
Customisation
UnitSelector manages the SelectionArea behaviour with the following interface:
To implement your own selection area, create a new class that extends ASelectionArea and implements the interface shown above. You can take a look at these supported selection areas as a guide if you get stuck: RectangleSelectionArea, CubeSelectionArea.
Last updated