Replies: 1 comment
-
Additionally, how would you initialize the EventFilter at the correct time? If a query naturally has an EventFilter that gets created internally when the query is ready to be used, then it seems that the only time to initialize the EventFilter is in the OnUpdate method. You cannot access it in the constructor like you can for the query filter. But then, how do you ensure that you actually receive the events that you need? For example, if system A runs and then system B runs, and A creates some new entities and assigns some components, how might system B use an event filter to catch these entities and process them on the very first update call? As far as I can tell, you can't because system B has not initialized yet and therefore has no event filter to keep track of changes yet. I would rather not hook onto the "component added" event on the entire EntityStore, since that slows down every single component change forever. I guess I would just ignore the built-in EventFilter that gets created automatically per-query, instead opting to handle my own as part of the system state? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation gives a clear example of how to initialize an EventFilter in a standalone query, but inside a QuerySystem where could potentially be multiple stores involved, is there a simple way to do it? The base class has no EventFilter variable to access in the constructor, only a Filter.
Do I just manually track which queries I have initialized?
Beta Was this translation helpful? Give feedback.
All reactions