feat: add play mode pause resume and step controls
This commit is contained in:
@@ -131,4 +131,25 @@ TEST_F(RuntimeLoopTest, PauseSkipsAutomaticTicksUntilStepFrameIsRequested) {
|
||||
EXPECT_TRUE(loop.IsPaused());
|
||||
}
|
||||
|
||||
TEST_F(RuntimeLoopTest, ResumeRestoresAutomaticTickProgressionAfterPause) {
|
||||
RuntimeLoop loop({0.02f, 0.1f, 4});
|
||||
Scene* scene = CreateScene();
|
||||
GameObject* host = scene->CreateGameObject("Host");
|
||||
host->AddComponent<RuntimeLoopObserverComponent>(&counters);
|
||||
|
||||
loop.Start(scene);
|
||||
loop.Pause();
|
||||
loop.Tick(0.025f);
|
||||
EXPECT_EQ(counters.updateCount, 0);
|
||||
|
||||
loop.Resume();
|
||||
EXPECT_FALSE(loop.IsPaused());
|
||||
loop.Tick(0.025f);
|
||||
|
||||
EXPECT_EQ(counters.startCount, 1);
|
||||
EXPECT_EQ(counters.fixedUpdateCount, 1);
|
||||
EXPECT_EQ(counters.updateCount, 1);
|
||||
EXPECT_EQ(counters.lateUpdateCount, 1);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user