主版本(支持渲染版本移动分支至support_engine)

This commit is contained in:
yhh
2021-01-13 13:09:04 +08:00
parent 6699c32f73
commit eca9ba7b82
23 changed files with 607 additions and 2300 deletions

View File

@@ -82,9 +82,6 @@ module es {
for (let component of this._components) {
if (!component) continue;
if (component instanceof RenderableComponent)
new linq.List(this._entity.scene.renderableComponents.buffer).remove(component);
// 处理IUpdatable
if (isIUpdatable(component))
new linq.List(this._updatableComponents).remove(component);
@@ -96,9 +93,6 @@ module es {
public registerAllComponents() {
for (let component of this._components) {
if (component instanceof RenderableComponent)
this._entity.scene.renderableComponents.buffer.push(component);
if (isIUpdatable(component))
this._updatableComponents.push(component);
@@ -124,9 +118,6 @@ module es {
for (let i = 0, count = this._componentsToAdd.length; i < count; i++) {
let component = this._componentsToAdd[i];
if (component instanceof RenderableComponent)
this._entity.scene.renderableComponents.buffer.push(component);
if (isIUpdatable(component))
this._updatableComponents.push(component);
@@ -162,9 +153,6 @@ module es {
}
public handleRemove(component: Component) {
if (component instanceof RenderableComponent)
new linq.List(this._entity.scene.renderableComponents.buffer).remove(component);
if (isIUpdatable(component))
new linq.List(this._updatableComponents).remove(component);
@@ -254,12 +242,5 @@ module es {
for (let i = 0; i < this._components.length; i++)
this._components[i].onDisabled();
}
public debugRender(batcher: IBatcher) {
for (let i = 0; i < this._components.length; i++) {
if (this._components[i].enabled)
this._components[i].debugRender(batcher);
}
}
}
}