Skip to content

Commit

Permalink
pause for 5 frames
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Oct 21, 2024
1 parent 1a2df4a commit a9d3a27
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/testbed/3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn main() {

#[derive(Debug, Clone, Eq, PartialEq, Hash, States)]
enum SceneState {
PauseBefore(Scene),
PauseBefore(Scene, u32),
Running(Scene),
}

Expand Down Expand Up @@ -75,11 +75,12 @@ fn switch_scene(
CiTestingCustomEvent(event) => event == "switch_scene",
});
}
if should_switch || matches!(scene.get(), SceneState::PauseBefore(_)) {
if should_switch || matches!(scene.get(), SceneState::PauseBefore(_, _)) {
info!("Switching scene");
next_scene.set(match scene.get() {
SceneState::Running(scene) => SceneState::PauseBefore(scene.next()),
SceneState::PauseBefore(scene) => SceneState::Running(*scene),
SceneState::Running(scene) => SceneState::PauseBefore(scene.next(), 5),
SceneState::PauseBefore(scene, 0) => SceneState::Running(*scene),
SceneState::PauseBefore(scene, n) => SceneState::PauseBefore(*scene, n - 1),
});
}
}
Expand Down

0 comments on commit a9d3a27

Please sign in to comment.