Skip to content

Commit

Permalink
[Bug] 修复从动画编辑模式切换到prefab模式时数据丢失导致的各种问题 (cocos#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogeFu committed Mar 25, 2022
1 parent 2aa6cfd commit 5fce0a3
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ class ToPrefabTransition<TState extends ISceneFacadeState> extends Transition<TS
public async Complete() {
super.Complete();

if (this.fromState.modeName === SceneModeType.General) {
// 将普通模式暂时挂起
this.fromState.isHold = true;
await this.fromState.stagingSceneState();
// TODO: 为了清空各个管理器的数据,发一条场景关闭消息,后面可能有更好的方式
this.fromState.fireCloseEvent();
}
// 从动画模式直接跳转到prefab模式的时候也需要处理一下 否则node._prefab.asset数据会丢失 #11679
// if (this.fromState.modeName === SceneModeType.General) {
// 将普通模式暂时挂起
this.fromState.isHold = true;
await this.fromState.stagingSceneState();
// TODO: 为了清空各个管理器的数据,发一条场景关闭消息,后面可能有更好的方式
this.fromState.fireCloseEvent();
// }
}
}

Expand Down

0 comments on commit 5fce0a3

Please sign in to comment.