-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Legion change events are fired for all mut queries #6
Comments
Oh my, yes why did we not think of that in Amethyst. The nuance between Deref and DerefMut makes it ideal to detect between simple check read and actual modification in many cases. Could this be expanded to also trigger some “event” in case an actual mutation happens? It seems harder as it means the components would somehow point back to their archetype chunk to mark the chunk as containing change. But maybe it is achievable. |
Yeah the Deref/DerefMut distinction is definitely what makes this viable. Rust is so great :) And yeah i do think its worth exploring "on mutate" events. I'm pretty sure legion already has event infrastructure for cases like this that feeds off of the archetype change state. We might even get it for free if we implement this using the same approach as the existing mutation events! |
As we are no longer using legion, im closing this in favor of #54 |
I believe you forgot to close it! |
Bawhaha I certainly did 😊 |
Legion component change events / filters are fired whenever a system query contains
Write<Component>
. This makes these events useless for logic that needs to run when components are actually changed / as an optimization.This might be solvable with some custom RefMut logic:
The text was updated successfully, but these errors were encountered: