ecsyjs / ecsy

Entity Component System for javascript
https://ecsyjs.github.io/ecsy/
MIT License
1.11k stars 115 forks source link

Fix entity not calling `dispose` on components when removed #253

Closed DavidPeicho closed 4 years ago

DavidPeicho commented 4 years ago

When entity are destroyed, either by calling removeAllEntities or Entity.remove(), the component don't get disposed. This is because removeEntity() is called first, clearing the components list whem the pool calls entity.reset().

DavidPeicho commented 4 years ago

I believe there are other little issues linked to this one, such as https://github.com/MozillaReality/ecsy-three/issues/31

robertlong commented 4 years ago

LGTM, thanks for doing this!