Skip to content

Commit da13ade

Browse files
zhaopjakobhellermann
authored andcommitted
Use app.world_mut() or .world() instead of .world
Addresses Bevy [9202](bevyengine/bevy#9202)
1 parent a55be95 commit da13ade

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

crates/bevy_editor_pls/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl Plugin for EditorPlugin {
8585
if window.title == "Bevy App" {
8686
window.title = "bevy_editor_pls".into();
8787
}
88-
let entity = app.world.spawn(window);
88+
let entity = app.world_mut().spawn(window);
8989
WindowRef::Entity(entity.id())
9090
}
9191
EditorWindowPlacement::Window(entity) => WindowRef::Entity(entity),
@@ -136,7 +136,7 @@ impl Plugin for EditorPlugin {
136136
app.insert_resource(controls::EditorControls::default_bindings())
137137
.add_systems(Update, controls::editor_controls_system);
138138

139-
let mut internal_state = app.world.resource_mut::<editor::EditorInternalState>();
139+
let mut internal_state = app.world_mut().resource_mut::<editor::EditorInternalState>();
140140

141141
let [game, _inspector] =
142142
internal_state.split_right::<InspectorWindow>(egui_dock::NodeIndex::root(), 0.75);

crates/bevy_editor_pls_core/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<W: EditorWindow> Plugin for WindowSetupPlugin<W> {
3939

4040
impl AddEditorWindow for App {
4141
fn add_editor_window<W: EditorWindow>(&mut self) -> &mut Self {
42-
let mut editor = self.world.get_resource_mut::<Editor>().expect("Editor resource missing. Make sure to add the `EditorPlugin` before calling `app.add_editor_window`.");
42+
let mut editor = self.world_mut().get_resource_mut::<Editor>().expect("Editor resource missing. Make sure to add the `EditorPlugin` before calling `app.add_editor_window`.");
4343
editor.add_window::<W>();
4444

4545
self.add_plugins(WindowSetupPlugin::<W>(PhantomData));
@@ -69,9 +69,9 @@ impl Plugin for EditorPlugin {
6969
let (window_entity, always_active) = match self.window {
7070
WindowRef::Primary => {
7171
let entity = app
72-
.world
72+
.world_mut()
7373
.query_filtered::<Entity, With<PrimaryWindow>>()
74-
.single(&app.world);
74+
.single(&app.world());
7575
(entity, false)
7676
}
7777
WindowRef::Entity(entity) => (entity, true),

crates/bevy_editor_pls_default_windows/src/debug_settings/debugdump.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn setup(app: &mut App) {
2424
return;
2525
}
2626
};
27-
let render_graph = render_app.world.get_resource::<RenderGraph>().unwrap();
27+
let render_graph = render_app.world().get_resource::<RenderGraph>().unwrap();
2828

2929
let schedule_settings = schedule_graph::settings::Settings {
3030
include_system: Some(Box::new(|system| {
@@ -35,18 +35,18 @@ pub fn setup(app: &mut App) {
3535
let rendergraph_settings = render_graph::settings::Settings::default();
3636

3737
let update_schedule = app.get_schedule(Update).map(|schedule| {
38-
schedule_graph::schedule_graph_dot(schedule, &app.world, &schedule_settings)
38+
schedule_graph::schedule_graph_dot(schedule, &app.world(), &schedule_settings)
3939
});
4040

4141
let fixed_update_schedule = app.get_schedule(FixedUpdate).map(|schedule| {
42-
schedule_graph::schedule_graph_dot(schedule, &app.world, &schedule_settings)
42+
schedule_graph::schedule_graph_dot(schedule, &app.world(), &schedule_settings)
4343
});
4444

4545
let render_main_schedule = render_app.get_schedule(Render).map(|schedule| {
46-
schedule_graph::schedule_graph_dot(schedule, &app.world, &schedule_settings)
46+
schedule_graph::schedule_graph_dot(schedule, &app.world(), &schedule_settings)
4747
});
4848
let render_extract_schedule = render_app.get_schedule(ExtractSchedule).map(|schedule| {
49-
schedule_graph::schedule_graph_dot(schedule, &app.world, &schedule_settings)
49+
schedule_graph::schedule_graph_dot(schedule, &app.world(), &schedule_settings)
5050
});
5151

5252
let render_graph = render_graph::render_graph_dot(render_graph, &rendergraph_settings);

crates/bevy_editor_pls_default_windows/src/gizmos.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl EditorWindow for GizmoWindow {
117117
}
118118

119119
fn app_setup(app: &mut App) {
120-
let mut materials = app.world.resource_mut::<Assets<StandardMaterial>>();
120+
let mut materials = app.world_mut().resource_mut::<Assets<StandardMaterial>>();
121121
let material_light = materials.add(StandardMaterial {
122122
base_color: Color::rgba_u8(222, 208, 103, 255),
123123
unlit: true,
@@ -133,10 +133,10 @@ impl EditorWindow for GizmoWindow {
133133
..default()
134134
});
135135

136-
let mut meshes = app.world.resource_mut::<Assets<Mesh>>();
136+
let mut meshes = app.world_mut().resource_mut::<Assets<Mesh>>();
137137
let sphere = meshes.add(Sphere { radius: 0.3 });
138138

139-
app.world.insert_resource(GizmoMarkerConfig {
139+
app.world_mut().insert_resource(GizmoMarkerConfig {
140140
point_light_mesh: sphere.clone(),
141141
point_light_material: material_light.clone(),
142142
directional_light_mesh: sphere.clone(),

0 commit comments

Comments
 (0)