EasyEcs
API reference

ICleanupComponent

Marks a component that outlives the destruction of its entity: destroying an entity holding one removes its other components and adds the Destroyed tag…

public interface ICleanupComponent : IComponent

Marks a component that outlives the destruction of its entity: destroying an entity holding one removes its other components and adds the Destroyed tag instead of freeing it, so a system can release what the component stands for (a socket, a reservation, a slot in another service) and then remove it. Removing the entity's last cleanup component frees it. Use it for resources outside the world that must be released exactly once.

Edit on GitHub

Last updated on

How is this guide?