Class AllCharactersTargetSelector
Selects every scene UnityEngine.GameObject with a component that implements ICharacter.
[Serializable]
public class AllCharactersTargetSelector : TargetSelector
- Inheritance
-
AllCharactersTargetSelector
- Inherited Members
Fields
IncludeInactive
True to include inactive GameObjects when collecting scene characters.
[Tooltip("True to include inactive GameObjects when collecting scene characters.")]
public bool IncludeInactive
Field Value
IncludeUnspawned
True to include characters that are not currently spawned.
[Tooltip("True to include characters that are not currently spawned.")]
public bool IncludeUnspawned
Field Value
Methods
SelectTargets(EventData)
Returns all GameObjects in the context's scene that have a component implementing ICharacter.
public override IEnumerable<GameObject> SelectTargets(EventData eventData)
Parameters
eventDataEventDataThe event data driving the selection.
Returns
- IEnumerable<GameObject>
An enumerable of character GameObjects, ordered by network identity.
Remarks
Server only, and the one spatial-family selector that stayed that way when the rest were opened up for client-side prediction. The others ask "which bodies are inside this volume", a question the caster's client can answer for itself because its live world is the same world the server rewinds to. This one asks "who is in the ZONE", and a client simply does not hold that set: observer streaming gives it only the characters currently spawned for that viewer, so predicting here would not be a boundary mispick but a systematic under-selection — every culled character silently missing from an effect that is defined as hitting everyone. It is also the only selector that pays a full-scene component scan, which does not belong on a player's machine once per tick.
The consequence is honest and deliberate: a zone-wide effect has no predicted feedback and lands when the server says so. See ResolvesTargetsLocally(EventData).
Ordered. FindObjectsByType is called with FindObjectsSortMode.None,
which returns whatever order the scene's object registry happens to hold — not the
hierarchy order, and not the same order twice. Anything downstream that caps the set,
stops at the first match, or rolls against it was choosing arbitrarily. Sorting by network
identity costs one pass and makes the fan-out reproducible.