修复场景切换未在临界点切换问题
This commit is contained in:
@@ -145,7 +145,7 @@ class Scene extends egret.DisplayObjectContainer {
|
||||
this.unload();
|
||||
}
|
||||
|
||||
protected onStart() {
|
||||
protected async onStart() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
///<reference path="./BaseView.ts" />
|
||||
/** 用于承载fui界面 */
|
||||
class BaseFuiView extends BaseView {
|
||||
/** 界面名称 */
|
||||
|
||||
Reference in New Issue
Block a user