How to add event to system set #1774
Answered
by
alice-i-cecile
saberuster
asked this question in
Q&A
-
i want to add event like this: pub fn add_system_set_event<T>(&mut self) -> &mut Self
where
T: Component,
{
self.insert_resource(Events::<T>::default())
.add_system_set_to_stage(CoreStage::First, SystemSet::new()
.with_run_criteria(FixedTimestep::step(2.0))
.with_system(Events::<T>::update_system.system()))
} because i want reuse the event system cache logic. i known timer system can do "fixed time" logic, but it is not cache. I’m not sure if this example is a new requirement, or any other way can do this in bevy |
Beta Was this translation helpful? Give feedback.
Answered by
alice-i-cecile
Mar 31, 2021
Replies: 1 comment 1 reply
-
Ah: are you trying to ensure that your events persist across the fixed time step? Is there anything else you need from this functionality? For now, I expect that swapping to manual event management (by replacing the update_system with your own logic) is the best approach. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
saberuster
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah: are you trying to ensure that your events persist across the fixed time step? Is there anything else you need from this functionality?
For now, I expect that swapping to manual event management (by replacing the update_system with your own logic) is the best approach.