如何将事件添加到 bevy 中的系统集

问题描述

我想添加这样的事件:

    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()))
}

因为我想重用事件系统缓存逻辑。

我知道计时器系统可以执行“固定时间”逻辑,但它不是缓存。

我不确定这个例子是否是一个新的要求,或者任何其他方式都可以做到这一点

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)