pub struct SystemCombinator;Expand description
系统组合器
提供系统组合和配置的便捷方法。
Implementations§
Source§impl SystemCombinator
impl SystemCombinator
Sourcepub fn chain<M>(systems: impl IntoSystemConfigs<M>) -> impl IntoSystemConfigs<M>
👎Deprecated since 0.2.0: 不提供链式调度功能,请直接使用 bevy_ecs 的 .before()/.after() 排序
pub fn chain<M>(systems: impl IntoSystemConfigs<M>) -> impl IntoSystemConfigs<M>
不提供链式调度功能,请直接使用 bevy_ecs 的 .before()/.after() 排序
创建系统链
将多个系统按顺序链接执行。
§示例
use anvilkit_ecs::prelude::*;
use anvilkit_ecs::schedule::AnvilKitSchedule;
fn system_a() { println!("系统 A"); }
fn system_b() { println!("系统 B"); }
fn system_c() { println!("系统 C"); }
let mut app = App::new();
app.add_systems(AnvilKitSchedule::Update, (
system_a,
system_b.after(system_a),
system_c.after(system_b),
));Sourcepub fn parallel<M>(
systems: impl IntoSystemConfigs<M>,
) -> impl IntoSystemConfigs<M>
👎Deprecated since 0.2.0: 不提供并行调度功能,bevy_ecs 系统默认并行执行
pub fn parallel<M>( systems: impl IntoSystemConfigs<M>, ) -> impl IntoSystemConfigs<M>
不提供并行调度功能,bevy_ecs 系统默认并行执行
创建并行系统组
将多个系统组合为可并行执行的组。
§示例
use anvilkit_ecs::prelude::*;
use anvilkit_ecs::schedule::AnvilKitSchedule;
fn physics_system() { println!("物理系统"); }
fn audio_system() { println!("音频系统"); }
fn input_system() { println!("输入系统"); }
let mut app = App::new();
app.add_systems(AnvilKitSchedule::Update, (
physics_system,
audio_system,
input_system,
));Auto Trait Implementations§
impl Freeze for SystemCombinator
impl RefUnwindSafe for SystemCombinator
impl Send for SystemCombinator
impl Sync for SystemCombinator
impl Unpin for SystemCombinator
impl UnsafeUnpin for SystemCombinator
impl UnwindSafe for SystemCombinator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.