From a9d3a278d3ccdccdd9d77150740b28f5ae770e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Mon, 21 Oct 2024 23:36:54 +0200 Subject: [PATCH] pause for 5 frames --- examples/testbed/3d.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/testbed/3d.rs b/examples/testbed/3d.rs index 0b6a085cb9e16..103dcedd6e9b4 100644 --- a/examples/testbed/3d.rs +++ b/examples/testbed/3d.rs @@ -31,7 +31,7 @@ fn main() { #[derive(Debug, Clone, Eq, PartialEq, Hash, States)] enum SceneState { - PauseBefore(Scene), + PauseBefore(Scene, u32), Running(Scene), } @@ -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), }); } }