判断接口更改、新增FrameUpdated核心事件

This commit is contained in:
yhh
2020-11-24 12:15:20 +08:00
parent e67f568069
commit 5c0ee92d85
8 changed files with 14 additions and 15 deletions

View File

@@ -17,5 +17,5 @@ module es {
}
}
export var isIUpdatable = (props: any): props is IUpdatable => typeof (props as IUpdatable)['js'] !== 'undefined';
export var isIUpdatable = (props: any): props is IUpdatable => typeof (props as IUpdatable)['update'] !== 'undefined';
}

View File

@@ -31,6 +31,7 @@ module es {
Core._instance = this;
Core.emitter = new Emitter<CoreEvents>();
Core.emitter.addObserver(CoreEvents.FrameUpdated, this.update, this);
Core.registerGlobalManager(this._timerManager);

View File

@@ -12,5 +12,9 @@ module es {
* 当设备方向改变时触发
*/
OrientationChanged,
/**
* 当每帧事件触发时
*/
FrameUpdated,
}
}

View File

@@ -124,11 +124,6 @@ module es {
}
public render() {
if (this._renderers.length == 0) {
console.error("场景中没有渲染器!");
return;
}
for (let i = 0; i < this._renderers.length; i++) {
this._renderers[i].render(this);
}