update
This commit is contained in:
@@ -82,6 +82,9 @@ 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);
|
||||
@@ -93,6 +96,9 @@ 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);
|
||||
|
||||
@@ -118,6 +124,9 @@ 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);
|
||||
|
||||
@@ -153,7 +162,8 @@ module es {
|
||||
}
|
||||
|
||||
public handleRemove(component: Component) {
|
||||
if (!component) return;
|
||||
if (component instanceof RenderableComponent)
|
||||
new linq.List(this._entity.scene.renderableComponents.buffer).remove(component);
|
||||
|
||||
if (isIUpdatable(component))
|
||||
new linq.List(this._updatableComponents).remove(component);
|
||||
|
||||
Reference in New Issue
Block a user