[Suggestion] Remove entities with no components
See original GitHub issueRight now it is possible to remove all components on an entity and have a blank component-less entity orphaned in the pool. What do you think of adding a check on component removed that removes the Entity if it has no remaining components?
I have a few place in my code handling manual cleanup, but it would be really nice to have this handled by Entitas. I could see this having an issue with the OnComponentRemoved callback, but there may be a way to work around that.
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (17 by maintainers)
Top Results From Across the Web
[Suggestion] Remove entities with no components #117
Right now it is possible to remove all components on an entity and have a blank component-less entity orphaned in the pool.
Read more >How to remove unavailable entities? - Configuration
I searched google, but can not find a solution to remove them? it says: “Deze entiteit heeft geen unieke ID” (This entity has...
Read more >Learning Entity-Component System. Deleting ...
To kill an entity, put into a kill bin/tag it/whatever, and after every frame or kill cycle, remove the components for each entity...
Read more >Efficient removal and adding of Components in ECS
So, i figured out how to do it quick and dirty, i subclassed Array (libGDX.util) to allow for faster removal of Entities and...
Read more >Remove ComponentType from all entities?
Hello, I was wondering what the best way to remove a single component type from all entities that have it. Here's my use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I was reading through the discussion again, but I still have the points in my head that I made earlier. I think your solution with a custom cleanup system as a last system in your list could solve this.
And yes, there is a way for having one system for multiple pools (pretty new feature): See AnimateDestroyViewSystem.cs
PoolExtension.cs