修复Vector2.zero引起的引用混乱问题

This commit is contained in:
yhh
2020-08-26 19:56:48 +08:00
parent 1997b3f348
commit e81f98ff17
33 changed files with 1663 additions and 4645 deletions

View File

@@ -29,6 +29,7 @@ module es {
* 全局访问系统
*/
public _globalManagers: GlobalManager[] = [];
public _timerManager: TimerManager = new TimerManager();
constructor() {
super();
@@ -38,6 +39,8 @@ module es {
Core.content = new ContentManager();
this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
Core.registerGlobalManager(this._timerManager);
}
/**
@@ -70,8 +73,8 @@ module es {
}
if (this._instance._scene == null) {
this._instance._scene = value;
this._instance.addChild(value);
this._instance._scene = value;
this._instance._scene.begin();
Core.Instance.onSceneChanged();
} else {
@@ -123,6 +126,17 @@ module es {
return null;
}
/**
* 调度一个一次性或重复的计时器,该计时器将调用已传递的动作
* @param timeInSeconds
* @param repeats
* @param context
* @param onTime
*/
public static schedule(timeInSeconds: number, repeats: boolean = false, context: any = null, onTime: (timer: ITimer)=>void){
return this._instance._timerManager.schedule(timeInSeconds, repeats, context, onTime);
}
public onOrientationChanged() {
Core.emitter.emit(CoreEvents.OrientationChanged);
}
@@ -210,8 +224,8 @@ module es {
this._nextScene = null;
this.onSceneChanged();
this.addChild(this._scene);
await this._scene.begin();
this.addChild(this._scene);
}
}