Skip to content

Commit

Permalink
Mention DynamicSceneBuilder in scene example (#10441)
Browse files Browse the repository at this point in the history
# Objective

Make ```DynamicSceneBuilder``` more visible to new bevy learners!
```DynamicSceneBuilder``` is likely to be the most appropriate tool to use when creating dynamic scenes in all but the simplest scenarios. However, it's not mentioned in the scene example. This PR aims to fix this.

## Solution

I've modified the comment above where the ```DynamicScene``` is created to note that ```DynamicSceneBuilder``` can also be used to create the scene. I believe this is the best approach to introduce ```DynamicSceneBuilder``` without adding additional complexity to the example.
  • Loading branch information
thepackett authored Nov 30, 2023
1 parent 74ead1e commit e581d74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/scene/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ fn save_scene_system(world: &mut World) {
scene_world.spawn(ComponentA { x: 3.0, y: 4.0 });
scene_world.insert_resource(ResourceA { score: 1 });

// With our sample world ready to go, we can now create our scene:
// With our sample world ready to go, we can now create our scene using DynamicScene or DynamicSceneBuilder.
// For simplicity, we will create our scene using DynamicScene:
let scene = DynamicScene::from_world(&scene_world);

// Scenes can be serialized like this:
Expand Down

0 comments on commit e581d74

Please sign in to comment.