优化component add/remove效率

This commit is contained in:
yhh
2021-04-20 15:46:18 +08:00
parent 17b36f01b0
commit b5d0fc6d0d
7 changed files with 209 additions and 220 deletions

View File

@@ -7,10 +7,7 @@ module es {
* 核心发射器。只发出核心级别的事件
*/
public static emitter: Emitter<CoreEvents>;
/**
* 启用/禁用焦点丢失时的暂停。如果为真,则不调用更新或渲染方法
*/
public static pauseOnFocusLost = true;
public static paused = false;
/**
* 是否启用调试渲染
*/
@@ -179,6 +176,10 @@ module es {
}
protected async update(currentTime: number = -1) {
if (Core.paused) {
return;
}
Time.update(currentTime);
if (this._scene != null) {
for (let i = this._globalManagers.length - 1; i >= 0; i--) {