Class AreaTargetSelector
Selects all UnityEngine.GameObjects within a certain radius of the context object. Useful for area-of-effect abilities or detection.
[Serializable]
public class AreaTargetSelector : TargetSelector
- Inheritance
-
AreaTargetSelector
- Inherited Members
Fields
MaxHits
Maximum number of hits to process in the area.
[Tooltip("Maximum number of hits to process in the area.")]
[Min(1)]
public int MaxHits
Field Value
Radius
Radius of the area effect.
[Tooltip("Radius of the area effect.")]
[Min(0)]
public float Radius
Field Value
TargetLayer
Layer mask to filter targets in the area.
[Tooltip("Layer mask to filter targets in the area.")]
public LayerMask TargetLayer
Field Value
- LayerMask
Methods
SelectTargets(EventData)
Returns all UnityEngine.GameObjects within Radius of the context object, filtered by TargetLayer.
public override IEnumerable<GameObject> SelectTargets(EventData eventData)
Parameters
eventDataEventDataThe event driving the selection.
Returns
- IEnumerable<GameObject>
An enumerable of UnityEngine.GameObjects within the area, or empty if context is null.