Struct ManagedMovementOverrides
Helper for adding and removing hooks to the FollowerEntity component.
This is used to allow other systems to override the movement of the agent.
The callbacks are stored in AgentManagedStorage. A zero-sized marker component on the entity records that a callback exists, so the jobs that invoke them can skip the vast majority of agents with an ordinary query.
Registering and unregistering are queued, and take effect at the start of the next phase of the movement pipeline. This allows adding/removing callbacks from within the callback itself.
Callbacks are not transferred to a cloned agent, since a delegate registered for one agent is not meaningful for another.
Public Methods
Registers a callback that runs after the agent has calculated how it wants to move, except for local avoidance.
Registers a callback that runs before the agent calculates how it wants to move, but after it has repaired its path.
Registers a callback that will be called before the agent is moved, but after it has calculated how it wants to move.
Removes a callback previously added with AddAfterControlCallback.
Removes a callback previously added with AddBeforeControlCallback.
Removes a callback previously added with AddBeforeMovementCallback.
Public Static Methods
Unregistering is tolerant of a dead agent, unlike ValidateAdd, so that a component can remove its callback in OnDisable without caring whether the agent outlived it.