Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change system name of RunSystem to system type name, not param type name #3935

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/bevy_ecs/src/system/function_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,15 @@ pub trait RunSystem: Send + Sync + 'static {
/// Creates a concrete instance of the system for the specified `World`.
fn system(world: &mut World) -> ParamSystem<Self::Param> {
ParamSystem {
name: std::any::type_name::<Self>(),
run: Self::run,
state: SystemState::new(world),
}
}
}

pub struct ParamSystem<P: SystemParam> {
name: &'static str,
state: SystemState<P>,
run: fn(SystemParamItem<P>),
}
Expand All @@ -199,7 +201,7 @@ impl<P: SystemParam + 'static> System for ParamSystem<P> {
type Out = ();

fn name(&self) -> Cow<'static, str> {
self.state.meta().name.clone()
Cow::Borrowed(self.name)
}

fn new_archetype(&mut self, archetype: &Archetype) {
Expand Down