Class WorldSceneTrigger
Inline ECA trigger data for world-scene events (scene load, day start, night start, …).
Unlike the asset-based Trigger, this type is [Serializable] and
lives directly on a host MonoBehaviour so designers can author scene-specific responses
inline. Execution semantics — selector fan-out, condition branching, action dispatch —
are delegated to RunInline(TargetSelector, List<BaseCondition>, List<BaseAction>, List<BaseAction>, EventData) so this type stays in lock-step
with any future Trigger behaviour changes.
[Serializable]
public class WorldSceneTrigger
- Inheritance
-
WorldSceneTrigger
- Inherited Members
Fields
Conditions
[Header("Conditions")]
[Tooltip("Conditions that must pass before actions execute. Evaluated top-to-bottom; the first failure short-circuits the rest. Wrap children in a CompositeCondition for OR / NOT semantics.")]
[SerializeReference]
public List<BaseCondition> Conditions
Field Value
Name
Display name for this trigger entry. Surfaced by a custom property drawer so the Inspector list shows meaningful element labels instead of "Element 0".
public string Name
Field Value
OnConditionsMetActions
[Header("On Conditions Met")]
[Tooltip("Actions to execute when all conditions pass. Executed top-to-bottom. Order matters: an IAbortableAction with StopChainOnFailure set will abort every action below it in this list (and the rest of its fan-out targets) when its TryExecute returns false.")]
[FormerlySerializedAs("Actions")]
[SerializeReference]
public List<BaseAction> OnConditionsMetActions
Field Value
OnConditionsNotMetActions
[Header("On Conditions Not Met")]
[Tooltip("Actions to execute when any condition fails. Executed top-to-bottom with the same StopChainOnFailure semantics as the met branch.")]
[SerializeReference]
public List<BaseAction> OnConditionsNotMetActions
Field Value
TargetSelector
[Header("Targeting")]
[Tooltip("Optional selector used to choose scene targets. When null, the trigger executes once against the world-level event data.")]
[SerializeReference]
public TargetSelector TargetSelector
Field Value
Methods
Execute(EventData)
Executes this trigger against the supplied event data, delegating to the shared RunInline(TargetSelector, List<BaseCondition>, List<BaseAction>, List<BaseAction>, EventData) helper so this type benefits from every fix made to the ECA core (fault isolation, ambient ConditionFilter, fan-out rules).
public void Execute(EventData eventData)
Parameters
eventDataEventDataThe event data used by conditions and actions.
Sanitize()
Editor-only null-strip for SubclassSelector remnants. Mirrors
OnValidate() on a per-entry basis so host MonoBehaviours
can sanitise their WorldSceneTrigger lists from their own
OnValidate. Returns the total number of nulls removed across all three
inner lists.
public int Sanitize()
Returns
Events
OnExecuted
Raised after every Execute(EventData) call (mirrors OnExecuted). Subscribers receive the firing trigger and the original event data. Wrapped in try/catch so instrumentation cannot poison gameplay.
public static event Action<WorldSceneTrigger, EventData> OnExecuted