-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsimple.rs
29 lines (22 loc) · 841 Bytes
/
simple.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//! This example shows the simplest way to create a Perf UI.
//! (using defaults for everything)
use bevy::prelude::*;
use iyes_perf_ui::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
// we want Bevy to measure these values for us:
.add_plugins(bevy::diagnostic::FrameTimeDiagnosticsPlugin)
.add_plugins(bevy::diagnostic::EntityCountDiagnosticsPlugin)
.add_plugins(bevy::diagnostic::SystemInformationDiagnosticsPlugin)
.add_plugins(PerfUiPlugin)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
// spawn a camera to be able to see anything
commands.spawn(Camera2d);
// create a simple Perf UI with default settings
// and all entries provided by the crate:
commands.spawn(PerfUiAllEntries::default());
}