修复bitset调整数组大小时错误/componentTypeManager获取修复

This commit is contained in:
yhh
2020-11-24 18:21:26 +08:00
parent 73b484d894
commit 8bc367ab48
8 changed files with 50 additions and 32 deletions

View File

@@ -86,7 +86,7 @@ module es {
if (isIUpdatable(component))
this._updatableComponents.remove(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component), false);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component["__proto__"]["constructor"]), false);
this._entity.scene.entityProcessors.onComponentRemoved(this._entity);
}
}
@@ -98,7 +98,7 @@ module es {
if (isIUpdatable(component))
this._updatableComponents.add(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component));
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component["__proto__"]["constructor"]));
this._entity.scene.entityProcessors.onComponentAdded(this._entity);
}
}
@@ -123,7 +123,7 @@ module es {
if (isIUpdatable(component))
this._updatableComponents.add(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component));
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component["__proto__"]["constructor"]));
this._entity.scene.entityProcessors.onComponentAdded(this._entity);
this._components.add(component);
@@ -160,7 +160,7 @@ module es {
if (isIUpdatable(component))
this._updatableComponents.remove(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component), false);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(component["__proto__"]["constructor"]), false);
this._entity.scene.entityProcessors.onComponentRemoved(this._entity);
component.onRemovedFromEntity();