修复polygon数组错误 修复emit空注册报错
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
///<reference path="./Collider.ts" />
|
||||
class BoxCollider extends Collider {
|
||||
|
||||
public get width(){
|
||||
return (this.shape as Box).width;
|
||||
}
|
||||
@@ -21,4 +20,30 @@ class BoxCollider extends Collider {
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public get height(){
|
||||
return (this.shape as Box).height;
|
||||
}
|
||||
|
||||
public set height(value: number){
|
||||
this.setHeight(value);
|
||||
}
|
||||
|
||||
public setHeight(height: number){
|
||||
this._colliderRequiresAutoSizing = false;
|
||||
let box = this.shape as Box;
|
||||
if (height != box.height){
|
||||
box.updateBox(box.width, height);
|
||||
this._isPositionDirty = true;
|
||||
if (this.entity && this._isParentEntityAddedToScene)
|
||||
Physics.updateCollider(this);
|
||||
}
|
||||
}
|
||||
|
||||
constructor(){
|
||||
super();
|
||||
|
||||
this.shape = new Box(1, 1);
|
||||
this._colliderRequiresAutoSizing = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user