async scenetransition
This commit is contained in:
@@ -12,7 +12,7 @@ class FadeTransition extends SceneTransition {
|
||||
this._mask = new egret.Shape();
|
||||
}
|
||||
|
||||
public onBeginTransition() {
|
||||
public async onBeginTransition() {
|
||||
this._mask.graphics.beginFill(this.fadeToColor, 1);
|
||||
this._mask.graphics.drawRect(0, 0, SceneManager.stage.stageWidth, SceneManager.stage.stageHeight);
|
||||
this._mask.graphics.endFill();
|
||||
|
||||
@@ -37,8 +37,8 @@ abstract class SceneTransition {
|
||||
|
||||
}
|
||||
|
||||
public onBeginTransition() {
|
||||
this.loadNextScene();
|
||||
public async onBeginTransition() {
|
||||
await this.loadNextScene();
|
||||
this.transitionComplete();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,11 +56,10 @@ class WindTransition extends SceneTransition {
|
||||
SceneManager.stage.addChild(this._mask);
|
||||
}
|
||||
|
||||
public onBeginTransition() {
|
||||
public async onBeginTransition() {
|
||||
this.loadNextScene();
|
||||
this.tickEffectProgressProperty(this._windEffect, this.duration, this.easeType).then(()=>{
|
||||
this.transitionComplete();
|
||||
SceneManager.stage.removeChild(this._mask);
|
||||
});
|
||||
await this.tickEffectProgressProperty(this._windEffect, this.duration, this.easeType);
|
||||
this.transitionComplete();
|
||||
SceneManager.stage.removeChild(this._mask);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user