修复scenecomponent遍历更新报错

This commit is contained in:
yhh
2020-12-01 20:02:45 +08:00
parent 0d8878abef
commit f9284e9d8e
4 changed files with 7 additions and 12 deletions

View File

@@ -362,7 +362,7 @@ declare module es {
/** /**
* 当Core将这个场景设置为活动场景时这个将被调用 * 当Core将这个场景设置为活动场景时这个将被调用
*/ */
onStart(): Promise<void>; onStart(): void;
/** /**
* 在场景子类中重写这个,并在这里做任何必要的卸载。 * 在场景子类中重写这个,并在这里做任何必要的卸载。
* 当Core把这个场景从活动槽中移除时这个被调用。 * 当Core把这个场景从活动槽中移除时这个被调用。

View File

@@ -780,11 +780,6 @@ var es;
* 当Core将这个场景设置为活动场景时这个将被调用 * 当Core将这个场景设置为活动场景时这个将被调用
*/ */
Scene.prototype.onStart = function () { Scene.prototype.onStart = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
}; };
/** /**
* 在场景子类中重写这个,并在这里做任何必要的卸载。 * 在场景子类中重写这个,并在这里做任何必要的卸载。
@@ -822,8 +817,8 @@ var es;
// 更新我们的列表,以防它们有任何变化 // 更新我们的列表,以防它们有任何变化
this.entities.updateLists(); this.entities.updateLists();
for (var i = this._sceneComponents.length - 1; i >= 0; i--) { for (var i = this._sceneComponents.length - 1; i >= 0; i--) {
if (this._sceneComponents[i].enabled) if (this._sceneComponents.buffer[i].enabled)
this._sceneComponents[i].update(); this._sceneComponents.buffer[i].update();
} }
// 更新我们的实体解析器 // 更新我们的实体解析器
if (this.entityProcessors != null) if (this.entityProcessors != null)

File diff suppressed because one or more lines are too long

View File

@@ -32,7 +32,7 @@ module es {
/** /**
* 当Core将这个场景设置为活动场景时这个将被调用 * 当Core将这个场景设置为活动场景时这个将被调用
*/ */
public async onStart() { public onStart() {
} }
/** /**
@@ -87,8 +87,8 @@ module es {
this.entities.updateLists(); this.entities.updateLists();
for (let i = this._sceneComponents.length - 1; i >= 0; i--) { for (let i = this._sceneComponents.length - 1; i >= 0; i--) {
if (this._sceneComponents[i].enabled) if (this._sceneComponents.buffer[i].enabled)
this._sceneComponents[i].update(); this._sceneComponents.buffer[i].update();
} }
// 更新我们的实体解析器 // 更新我们的实体解析器