Skip to content

Commit 7bdc067

Browse files
committed
system yeet
1 parent 3140603 commit 7bdc067

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

crates/bevy_ecs/src/system/commands/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use bevy_utils::tracing::debug;
1010
pub use command_queue::CommandQueue;
1111
use std::marker::PhantomData;
1212

13-
use super::System;
13+
use super::{IntoSystem, System};
1414

1515
/// A [`World`] mutation.
1616
pub trait Command: Send + Sync + 'static {
@@ -155,9 +155,9 @@ impl<'a> Commands<'a> {
155155
}
156156

157157
/// Run a one-off [`System`].
158-
pub fn run_system(&mut self, system: impl System<In = (), Out = ()>) {
158+
pub fn run_system<Params>(&mut self, system: impl IntoSystem<(), (), Params>) {
159159
self.queue.push(RunSystem {
160-
system: Box::new(system),
160+
system: Box::new(system.system()),
161161
});
162162
}
163163

examples/ecs/system_command.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use bevy::{prelude::*, utils::Duration};
44
fn main() {
55
App::build()
66
.add_plugins(DefaultPlugins)
7-
.add_startup_system(spawn.system())
8-
.add_system(trigger_sync.system())
7+
.add_startup_system(spawn)
8+
.add_system(trigger_sync)
99
.run();
1010
}
1111

@@ -19,11 +19,8 @@ fn spawn(mut commands: Commands) {
1919

2020
fn trigger_sync(mut commands: Commands, mut last_sync: Local<f64>, time: Res<Time>) {
2121
if time.seconds_since_startup() - *last_sync > 5.0 {
22-
commands.run_system(
23-
sync_system
24-
.system()
25-
.config(|config| config.1 = Some(time.time_since_startup())),
26-
);
22+
commands
23+
.run_system(sync_system.config(|config| config.1 = Some(time.time_since_startup())));
2724
*last_sync = time.seconds_since_startup();
2825
}
2926
}

0 commit comments

Comments
 (0)