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