优化updatelist增快addEntity速度

This commit is contained in:
yhh
2020-10-09 15:39:06 +08:00
parent c9c745c730
commit 74fcfd7778
8 changed files with 137 additions and 114 deletions

View File

@@ -1,61 +0,0 @@
module es {
export class PrototypeSpriteRenderer extends SpriteRenderer {
public get width(): number {
return this._width;
}
public get height(): number {
return this._height;
}
public get bounds(): Rectangle {
if (this._areBoundsDirty){
this._bounds.calculateBounds(this.entity.transform.position, this._localOffset, this._origin, this.entity.transform.scale,
this.entity.transform.rotation, this._width, this._height);
this._areBoundsDirty = false;
}
return this._bounds;
}
public skewTopX: number = 0;
public skewBottomX: number = 0;
public skewLeftY: number = 0;
public skewRightY: number = 0;
public _width: number = 0;
public _height: number = 0;
constructor(width: number = 50, height: number = 50){
super(Graphics.Instance.pixelTexture);
this._width = width;
this._height = height;
}
public setWidth(width: number): PrototypeSpriteRenderer {
this._width = width;
return this;
}
public setHeight(height: number): PrototypeSpriteRenderer {
this._height = height;
return this;
}
public setSkew(skewTopX: number, skewBottomX: number, skewLeftY: number, skewRightY: number): PrototypeSpriteRenderer{
this.skewTopX = skewTopX;
this.skewBottomX = skewBottomX;
this.skewLeftY = skewLeftY;
this.skewRightY = skewRightY;
return this;
}
public onAddedToEntity() {
this.originNormalized = Vector2Ext.halfVector();
}
public render(camera: es.Camera) {
}
}
}