diff --git a/examples/xr.rs b/examples/xr.rs index 2ea58d5..d6bbb41 100644 --- a/examples/xr.rs +++ b/examples/xr.rs @@ -1,4 +1,5 @@ use std::f32::consts::PI; +use std::time::Duration; use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; use bevy::prelude::Gizmos; @@ -66,6 +67,10 @@ fn setup( transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y), ..default() },)); + + commands.insert_resource(RotationTimer { + timer: Timer::from_seconds(1.0, TimerMode::Once), + }) } pub enum LocomotionType { @@ -78,6 +83,11 @@ pub enum RotationType { Snap, } +#[derive(Resource)] +struct RotationTimer { + timer: Timer, +} + fn proto_locomotion( time: Res