evaera / matter

A modern ECS library for Roblox.
https://eryn.io/matter/
MIT License
141 stars 32 forks source link

Expose Topo cleanup routine #11

Closed sayhisam1 closed 2 years ago

sayhisam1 commented 2 years ago

Consider the following events: 1) you have a list of systems 2) you schedule said systems in a loop, and begin the loop 3) you cancel the loop by disconnecting the events 4) you restart the loop with a new set of systems

Currently, hook state for systems which are not included in step (4) lingers around, since the cleanup routine was never called for them. It'd be nice if there was a way to clean up all remaining hooks after a loop is terminated. This is useful for hot reloading.