Latest commit d7a897d
系统集
系统集能够方便地把通用的属性应用到多个系统。一般用来设置 Label、System Order of Execution、Run Criteria 和 State。
fn main() { App::new() .add_plugins(DefaultPlugins) // 把与 input 有关的系统归为一个集合 .add_system_set( SystemSet::new() .lebel("input") .with_system(keyboard_input) .with_system(gamepad_input) ) // 被 net 标记的系统会在被 input 标记的系统之前执行 .add_system_set( SystemSet::new() .label("net") .before("input") // 在 System Set 中,各个系统仍然可以有自己的标签或执行顺序 .with_system(servel_session.label("session")) .with_system(servel_updates.after("session")) ) // 未分组的系统 .add_system(player_movement.after("input")) .add_system(session_ui.after("session")) .add_system(smoke_particles) .run(); }