-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add/Remove system improvement #312
Comments
Thanks for opening the issue. |
Hi ! I want sometimes to do some code at specific moment in the engine (but just one time !) My solution was to create an EngineTaskSystem extends EntitySystem with priority 0 (first in my system list) EngineTaskSystem contains an Array of EngineTask
So i use EngineTaskSystem to insert new EntitySystem(task.priority()) and override update(dt) to call task.doTask() And when i test i see the problem to modify systems during iteration it work no problem but i like to keep only engine.update in my render() Anyway i think we need to do a little fix for fix the case of add/remove system during iteration. (why not throw exception) or this solution :D, perform operation at end of system update loop Thanks for reading |
Follow of : #311
Possibility to add or remove a system during the iteration and that the operation is effective on the current loop if the add/remove system has a lower priority than the current system.
Ex : You are in update loop, your system with priority 10 add a systeme with priority 15.
Actually => don't work at all
with #311 => the operation is performed at end of engine.update ()
goal=> operation perform immédialtly and the system.update is called in current loop (if his priority is lower than current)
The text was updated successfully, but these errors were encountered: