修复场景切换未在临界点切换问题

This commit is contained in:
yhh
2020-06-30 14:32:29 +08:00
parent 366bcf8efc
commit db7aac2b90
11 changed files with 423 additions and 58 deletions

View File

@@ -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();

View File

@@ -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;
}