Update Scene Example to Use scn.ron File (#1339)
This commit is contained in:
parent
5146112f5f
commit
cc9ed52ea7
@ -38,6 +38,6 @@ impl AssetLoader for SceneLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn extensions(&self) -> &[&str] {
|
fn extensions(&self) -> &[&str] {
|
||||||
&["scn"]
|
&["scn", "scn.ron"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ impl FromResources for ComponentB {
|
|||||||
|
|
||||||
fn load_scene_system(asset_server: Res<AssetServer>, mut scene_spawner: ResMut<SceneSpawner>) {
|
fn load_scene_system(asset_server: Res<AssetServer>, mut scene_spawner: ResMut<SceneSpawner>) {
|
||||||
// Scenes are loaded just like any other asset.
|
// 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.
|
// 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.
|
// This guarantees that it will not overwrite existing entities.
|
||||||
|
Loading…
Reference in New Issue
Block a user