Skip to content

Commit dc577da

Browse files
committed
Create an example to dump out all the schedule data.
1 parent 45b8bde commit dc577da

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

Cargo.toml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4559,6 +4559,24 @@ path = "examples/dev_tools/fps_overlay.rs"
45594559
doc-scrape-examples = true
45604560
required-features = ["bevy_dev_tools"]
45614561

4562+
[package.metadata.example.fps_overlay]
4563+
name = "FPS overlay"
4564+
description = "Demonstrates FPS overlay"
4565+
category = "Dev tools"
4566+
wasm = true
4567+
4568+
[[example]]
4569+
name = "schedule_data"
4570+
path = "examples/dev_tools/schedule_data.rs"
4571+
doc-scrape-examples = true
4572+
required-features = ["bevy_dev_tools", "debug"]
4573+
4574+
[package.metadata.example.schedule_data]
4575+
name = "Extract Schedule Data"
4576+
description = "Extracts the schedule data from a default app and writes it to a file"
4577+
category = "Dev tools"
4578+
wasm = true
4579+
45624580
[[example]]
45634581
name = "2d_top_down_camera"
45644582
path = "examples/camera/2d_top_down_camera.rs"
@@ -4656,12 +4674,6 @@ description = "Shows how to render 2D objects on top of Bevy UI"
46564674
category = "Camera"
46574675
wasm = true
46584676

4659-
[package.metadata.example.fps_overlay]
4660-
name = "FPS overlay"
4661-
description = "Demonstrates FPS overlay"
4662-
category = "Dev tools"
4663-
wasm = true
4664-
46654677
[[example]]
46664678
name = "visibility_range"
46674679
path = "examples/3d/visibility_range.rs"

examples/dev_tools/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app_data.ron
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//! This example demonstrates how to automatically serialize schedule data.
2+
3+
use bevy::{dev_tools::schedule_data::plugin::*, prelude::*};
4+
5+
fn main() {
6+
App::new()
7+
.add_plugins((DefaultPlugins, SerializeSchedulesPlugin::default()))
8+
// This resource is only necessary to put the output in a nice spot for the example code.
9+
.insert_resource(SerializeSchedulesFilePath(
10+
"examples/dev_tools/app_data.ron".into(),
11+
))
12+
.run();
13+
}

0 commit comments

Comments
 (0)