BaseSelectableDetector.cs

An abstract Unity MonoBehaviour class that serves as a base for detecting selectable objects in an RTS game. The core functionality is:

  • Abstract method TryGetSelectable() that attempts to find a selectable object at a given point

  • Inheriting classes must implement detection logic

  • Returns boolean success and outputs ISelectable interface through out parameter

Common use cases:

  • Raycast-based selection detection

  • Mouse hover detection

Last updated