fix: 还原场景中物理引擎更新顺序 (会影响爬梯)
This commit is contained in:
@@ -30,6 +30,12 @@ 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; // 设定一个标志,用于判断是否需要移除对象
|
||||
|
||||
// 更新所有游戏对象,先略过需要移除的对象
|
||||
@@ -51,12 +57,6 @@ 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_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user