Update Scene Example to Use scn.ron File (#1339)

This commit is contained in:
Zicklag 2021-01-28 16:14:50 -06:00 committed by GitHub
parent 5146112f5f
commit cc9ed52ea7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 2 deletions

View file

@ -38,6 +38,6 @@ impl AssetLoader for SceneLoader {
}
fn extensions(&self) -> &[&str] {
&["scn"]
&["scn", "scn.ron"]
}
}

View file

@ -49,7 +49,7 @@ impl FromResources for ComponentB {
fn load_scene_system(asset_server: Res<AssetServer>, mut scene_spawner: ResMut<SceneSpawner>) {
// Scenes are loaded just like any other asset.
let scene_handle: Handle<DynamicScene> = asset_server.load("scenes/load_scene_example.scn");
let scene_handle: Handle<DynamicScene> = asset_server.load("scenes/load_scene_example.scn.ron");
// SceneSpawner can "spawn" scenes. "Spawning" a scene creates a new instance of the scene in the World with new entity ids.
// This guarantees that it will not overwrite existing entities.