Class EventTargetSelector
Selects the Target already carried on the event — without running any spatial query. This is the intended default for triggers fired in response to an event that already resolved its own target, such as:
- Ability
OnHittriggers (collision target). - Region enter / exit triggers.
- Dialogue, item-use, or interaction triggers.
Falls back to the initiator's GameObject when the event has no Target — so an OnHit trigger fired as a self-cast (initiator == hit) still resolves correctly.
[Serializable]
public class EventTargetSelector : TargetSelector
- Inheritance
-
EventTargetSelector
- Inherited Members
Fields
FallbackToInitiator
When true, falls back to the initiator's GameObject if Target is null. Default true to match the implicit fallback used by actions/conditions. Disable when the trigger must not run unless an explicit Target was supplied.
[Tooltip("Fall back to the initiator when the event has no Target. Disable to require an explicit event target.")]
public bool FallbackToInitiator
Field Value
Methods
SelectTargets(EventData)
Yields the event's existing Target (or initiator fallback).
public override IEnumerable<GameObject> SelectTargets(EventData eventData)
Parameters
eventDataEventDataThe event data driving the selection.
Returns
- IEnumerable<GameObject>
An enumerable containing the resolved target, or empty when none.