xx 1 年之前
父節點
當前提交
3094c8099a
共有 3 個文件被更改,包括 22 次插入23 次删除
  1. 21 21
      assets/script/game/cheyin/cheyin_manager.ts
  2. 1 1
      assets/script/game/effect/weiqi_manager.ts
  3. 0 1
      assets/script/game/game.ts

+ 21 - 21
assets/script/game/cheyin/cheyin_manager.ts

@@ -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)
+        // }
     }
 }
 

+ 1 - 1
assets/script/game/effect/weiqi_manager.ts

@@ -30,7 +30,7 @@ export class weiqi_manager extends Component {
         // let car_in_effect_p = this.node.getComponent(UITransform).convertToNodeSpaceAR(car_world_p)
         // let dir = new Vec3(car_in_effect_p.x,car_in_effect_p.y-this.mCar.node.getComponent(UITransform).contentSize.height*0.5)
         // return dir
-        return  new Vec3(this.mCar.node.position.x,this.mCar.node.position.y-this.mCar.node.getComponent(UITransform).contentSize.height*0.5)
+        return  new Vec3(this.mCar.node.position.x,this.mCar.node.position.y-this.mCar.spr.getComponent(UITransform).contentSize.height*0.5)
     }
 
     public startEffect(){

+ 0 - 1
assets/script/game/game.ts

@@ -174,7 +174,6 @@ export class game extends Component {
          }
         item.position = new Vec3(0,this.mHeight)
         this.mHeight+=m_d.height
-        this.mWeiqiManager.node.setSiblingIndex(this.content.children.length)
         this.car.setSiblingIndex(this.content.children.length)
         item.getComponent(run_level_item).initView(m_d,this.sfList,this.sfBuffList,this.car.getComponent(car))
     }