From 79b60ca7f465cf44de7bb4bd2166d6aeebd5e125 Mon Sep 17 00:00:00 2001 From: Ziyu Date: Mon, 6 Oct 2025 11:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=9C=BA=E6=99=AF=E4=B8=AD?= =?UTF-8?q?=E7=89=A9=E7=90=86=E5=BC=95=E6=93=8E=E6=9B=B4=E6=96=B0=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/engine/scene/scene.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/scene/scene.cpp b/src/engine/scene/scene.cpp index ab5cf59..a22ac96 100644 --- a/src/engine/scene/scene.cpp +++ b/src/engine/scene/scene.cpp @@ -29,12 +29,6 @@ void Scene::init() { void Scene::update(float delta_time) { if (!is_initialized_) return; - - // 只有游戏进行中,才需要更新物理引擎和相机 - if (context_.getGameState().isPlaying()){ - context_.getPhysicsEngine().update(delta_time); - context_.getCamera().update(delta_time); - } bool need_remove = false; // 设定一个标志,用于判断是否需要移除对象 @@ -57,6 +51,12 @@ void Scene::update(float delta_time) { }); } + // 只有游戏进行中,才需要更新物理引擎和相机 + if (context_.getGameState().isPlaying()){ + context_.getPhysicsEngine().update(delta_time); + context_.getCamera().update(delta_time); + } + // 更新UI管理器 ui_manager_->update(delta_time, context_);