优化spriteRenderer渲染方法

This commit is contained in:
yhh
2020-07-08 18:12:17 +08:00
parent 299c1b8e7d
commit aea50926a9
25 changed files with 607 additions and 567 deletions

View File

@@ -6,6 +6,7 @@ class Camera extends Component {
private _minimumZoom = 0.3;
private _maximumZoom = 3;
private _position: Vector2 = Vector2.zero;
/**
* 如果相机模式为cameraWindow 则会进行缓动移动
* 该值为移动速度
@@ -67,11 +68,24 @@ class Camera extends Component {
}
public get position(){
return this.entity.position;
return this._position;
}
public set position(value: Vector2){
this.entity.position = value;
this._position = value;
}
public get x(){
return this._position.x;
}
public set x(value: number){
this._position.x = value;
}
public get y(){
return this._position.y;
}
public set y(value: number){
this._position.y = value;
}
constructor() {