ASelectableDetector.cs
An abstract Unity MonoBehaviour class that serves as a base for detecting selectable objects in an RTS game.
public abstract class ASelectableDetector : MonoBehaviour
{
public abstract bool TryGetSelectable(Vector3 point, out ISelectable selectable);
}
The core functionality is:
Abstract method
TryGetSelectable()
that attempts to find a selectable object at a given pointInheriting 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