相机渲染

This commit is contained in:
YHH
2020-06-18 23:22:54 +08:00
parent feaac83ee7
commit e83bb087ea
13 changed files with 124 additions and 47 deletions

View File

@@ -44,6 +44,9 @@ class ComponentList {
for (let i = 0; i < this._components.length; i ++){
let component = this._components[i];
if (component instanceof RenderableComponent)
this._entity.scene.renderableComponents.remove(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component), false);
this._entity.scene.entityProcessors.onComponentRemoved(this._entity);
}
@@ -53,6 +56,9 @@ class ComponentList {
for (let i = 0; i < this._components.length; i ++){
let component = this._components[i];
if (component instanceof RenderableComponent)
this._entity.scene.renderableComponents.add(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component));
this._entity.scene.entityProcessors.onComponentAdded(this._entity);
}
@@ -71,7 +77,8 @@ class ComponentList {
if (this._componentsToAdd.length > 0){
for (let i = 0, count = this._componentsToAdd.length; i < count; i ++){
let component = this._componentsToAdd[i];
if (component instanceof RenderableComponent)
this._entity.scene.renderableComponents.add(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component));
this._entity.scene.entityProcessors.onComponentAdded(this._entity);