|
@@ -11,7 +11,7 @@ export class CameraUtils extends Component {
|
|
// serializableDummy = 0;
|
|
// serializableDummy = 0;
|
|
private min:Vec3;
|
|
private min:Vec3;
|
|
private max:Vec3;
|
|
private max:Vec3;
|
|
- private out:Vec3;
|
|
|
|
|
|
+ private out:Vec3=new Vec3();
|
|
|
|
|
|
private startTime:number;
|
|
private startTime:number;
|
|
private endTime:number;
|
|
private endTime:number;
|
|
@@ -27,6 +27,8 @@ export class CameraUtils extends Component {
|
|
* @param max 最大值
|
|
* @param max 最大值
|
|
*/
|
|
*/
|
|
shake(time:number,min:Vec3,max:Vec3):void{
|
|
shake(time:number,min:Vec3,max:Vec3):void{
|
|
|
|
+ this.min=min;
|
|
|
|
+ this.max=max;
|
|
this.startTime=director.getCurrentTime();
|
|
this.startTime=director.getCurrentTime();
|
|
this.endTime=this.startTime+time;
|
|
this.endTime=this.startTime+time;
|
|
this.shakeing=true;
|
|
this.shakeing=true;
|
|
@@ -43,6 +45,9 @@ export class CameraUtils extends Component {
|
|
let currentTime:number=director.getCurrentTime();
|
|
let currentTime:number=director.getCurrentTime();
|
|
if(currentTime<this.endTime){
|
|
if(currentTime<this.endTime){
|
|
this.randomV3(this.min,this.max,this.out);
|
|
this.randomV3(this.min,this.max,this.out);
|
|
|
|
+ this.out.x+=this.startPos.x;
|
|
|
|
+ this.out.y+=this.startPos.y;
|
|
|
|
+ this.out.z+=this.startPos.z;
|
|
this.node.position=this.out;
|
|
this.node.position=this.out;
|
|
}else{
|
|
}else{
|
|
this.node.position=this.startPos;
|
|
this.node.position=this.startPos;
|