新增numberdictionary的散列键

This commit is contained in:
yhh
2020-06-16 20:22:22 +08:00
parent 447ea4efe4
commit 9e6e5eccc8
8 changed files with 49 additions and 8 deletions

View File

@@ -79,7 +79,7 @@ abstract class Collider extends Component{
}
let renderable = this.entity.getComponent<RenderableComponent>(RenderableComponent);
if (!renderable){
if (renderable){
let renderbaleBounds = renderable.bounds;
let width = renderbaleBounds.width / this.entity.transform.scale.x;
@@ -98,6 +98,11 @@ abstract class Collider extends Component{
this._isParentEntityAddedToScene = true;
this.registerColliderWithPhysicsSystem();
}
public onRemovedFromEntity(){
this.unregisterColliderWithPhysicsSystem();
this._isParentEntityAddedToScene = false;
}
public onEntityTransformChanged(comp: ComponentTransform){
switch (comp){