Function AgentManagedStorage.DestroyAgent
DestroyAgent
(EntityManager entityManager, Entity entity)
Destroys an agent entity, releasing its managed data first so that it dies immediately.
Internal
Static
void DestroyAgent (
EntityManager | entityManager | |
Entity | entity |
Destroys an agent entity, releasing its managed data first so that it dies immediately.
DestroyEntity on its own leaves the entity alive until AgentManagedDataCleanupSystem removes its AgentManagedRef, because that is a cleanup component. The entity would still be observable through EntityManager.Exists for the rest of the frame, with every other component already stripped. A* destroys its own agents through here so that destruction stays immediate, as it was before the managed data moved out of components.