|
@@ -17,13 +17,13 @@ export class cheyin_manager extends Component {
|
|
|
private mCar:car = null
|
|
|
private start_check:boolean = false
|
|
|
public init(car:car){
|
|
|
- this.mCar = car
|
|
|
- this.start_check = true
|
|
|
- this.old_pos = new Vec3(this.mCar.node.position.x,this.mCar.node.position.y)
|
|
|
- this.node.removeAllChildren()
|
|
|
- for (let index = 0; index < this.COUNT; index++) {
|
|
|
- this.addItem()
|
|
|
- }
|
|
|
+ // this.mCar = car
|
|
|
+ // this.start_check = true
|
|
|
+ // this.old_pos = new Vec3(this.mCar.node.position.x,this.mCar.node.position.y)
|
|
|
+ // this.node.removeAllChildren()
|
|
|
+ // for (let index = 0; index < this.COUNT; index++) {
|
|
|
+ // this.addItem()
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
public getOldPos(){
|
|
@@ -40,8 +40,8 @@ export class cheyin_manager extends Component {
|
|
|
}else{
|
|
|
audioManager.Instance().playSound(config.AUDIO.car_sha_che,0.1)
|
|
|
}
|
|
|
- let node = this.getCanUseItem()
|
|
|
- node.getComponent(cheyin_item).show()
|
|
|
+ // let node = this.getCanUseItem()
|
|
|
+ // node.getComponent(cheyin_item).show()
|
|
|
}
|
|
|
|
|
|
public getCanUseItem(){
|
|
@@ -63,18 +63,18 @@ export class cheyin_manager extends Component {
|
|
|
|
|
|
|
|
|
protected update(dt: number): void {
|
|
|
- this.node.position = new Vec3(0,this.mCar.node.parent.position.y)
|
|
|
- this.delay_count+=dt;
|
|
|
- if(this.delay_count>=this.delay_time){
|
|
|
- this.old_pos = new Vec3(this.mCar.node.position.x,this.mCar.node.position.y)
|
|
|
- this.delay_count = 0
|
|
|
- }
|
|
|
- let dis = Math.abs(this.mCar.node.position.x-this.old_pos.x)
|
|
|
- if(dis>200&&this.start_check){
|
|
|
- this.delay_count = 0
|
|
|
- this.showCheYin()
|
|
|
- this.old_pos = new Vec3(this.mCar.node.position.x,this.mCar.node.position.y)
|
|
|
- }
|
|
|
+ // this.node.position = new Vec3(0,this.mCar.node.parent.position.y)
|
|
|
+ // this.delay_count+=dt;
|
|
|
+ // if(this.delay_count>=this.delay_time){
|
|
|
+ // this.old_pos = new Vec3(this.mCar.node.position.x,this.mCar.node.position.y)
|
|
|
+ // this.delay_count = 0
|
|
|
+ // }
|
|
|
+ // let dis = Math.abs(this.mCar.node.position.x-this.old_pos.x)
|
|
|
+ // if(dis>150&&this.start_check){
|
|
|
+ // this.delay_count = 0
|
|
|
+ // this.showCheYin()
|
|
|
+ // this.old_pos = new Vec3(this.mCar.node.position.x,this.mCar.node.position.y)
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
|