β¬Selection Area
Read more about how selection areas work
Overview
Customisation
public abstract class ASelectionArea : MonoBehaviour
{
// ....
// Returns true if selection should start; invoked when mouse button press starts
public abstract bool ShouldMouseDragStartSelection(Vector2 startPosition);
// Updates visuals; invoked when mouse button press is active with it's new position
public abstract void MouseDragContinues(Vector2 newPosition);
// Removes the visuals; invoked when mouse button is released
public abstract void MouseDragStops();
// Returns current units within the selection area; Retrieved for highlighting
// and selecting units
public abstract List<GameObject> GetCurrentObjectsWithinArea(bool sortByDistance);
// ...
}Last updated