修复场景切换未在临界点切换问题
This commit is contained in:
@@ -19,8 +19,8 @@ class FadeTransition extends SceneTransition {
|
||||
SceneManager.stage.addChild(this._mask);
|
||||
|
||||
egret.Tween.get(this).to({ _alpha: 1}, this.fadeOutDuration * 1000, this.fadeEaseType)
|
||||
.call(() => {
|
||||
this.loadNextScene();
|
||||
.call(async () => {
|
||||
await this.loadNextScene();
|
||||
}).wait(this.delayBeforeFadeInDuration).call(() => {
|
||||
egret.Tween.get(this).to({ _alpha: 0 }, this.fadeOutDuration * 1000, this.fadeEaseType).call(() => {
|
||||
this.transitionComplete();
|
||||
|
||||
@@ -50,7 +50,7 @@ abstract class SceneTransition {
|
||||
}
|
||||
}
|
||||
|
||||
protected loadNextScene() {
|
||||
protected async loadNextScene() {
|
||||
if (this.onScreenObscured)
|
||||
this.onScreenObscured();
|
||||
|
||||
@@ -58,7 +58,7 @@ abstract class SceneTransition {
|
||||
this.isNewSceneLoaded = true;
|
||||
}
|
||||
|
||||
SceneManager.scene = this.sceneLoadAction();
|
||||
SceneManager.scene = await this.sceneLoadAction();
|
||||
this.isNewSceneLoaded = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user