Interface Context
- All Known Implementing Classes:
EventContext, IntervalContext, LocationContext, MapMarkerOverrideContext, PrefabPasteContext, PrefabRemoveContext, TriggerVolumeContext, WorldContext
ContextMap under a ContextKey. Context
objects are the primary mechanism by which conditions and actions share data within a running
event: a condition writes a value into the map and a later action reads it by the same key.
Each implementation must register itself with TYPE_CODEC using a unique string ID
so that context entries can be persisted and restored across world reloads.
Most implementations do not need to override cleanup(CommandBuffer, WorldEvent). Override it only when the
context holds a resource that must be released when the event ends, such as a reference to a
child event that should be stopped (see
EventContext) or a
world snapshot that must be restored (see
PrefabRemoveContext).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidcleanup(CommandBuffer<EntityStore> buffer, WorldEvent event) Called when the owning event ends, whether by success or failure.
-
Field Details
-
TYPE_CODEC
-
-
Method Details
-
cleanup
Called when the owning event ends, whether by success or failure.Override to release resources or trigger compensating actions. Enqueue any ECS mutations through
bufferrather than applying them directly. This method is only called for context entries that are still present in the map when the event ends; entries that were removed viaconsumeearlier in the event's lifetime will not havecleanupinvoked.- Parameters:
buffer- the command buffer for enqueuing ECS mutationsevent- the world event that just ended
-