xx hai 1 ano
pai
achega
ebfbe569fe
Modificáronse 1 ficheiros con 11 adicións e 4 borrados
  1. 11 4
      assets/script/game/car.ts

+ 11 - 4
assets/script/game/car.ts

@@ -108,7 +108,7 @@ export class car extends Component {
         this.hp_bar.getComponent(hp_bar).updateHp(this.hp)
         // this.hp = 100000
         if(isReLife){
-            
+
         }else{
             this.scores = 0
         }
@@ -252,7 +252,7 @@ export class car extends Component {
                     let buff_active_node = instantiate(this.buff_active_effect_pf)
                     buff_active_node.parent = buff_info.node.parent
     
-                    console.log("data.buff_type::",data.buff_type)
+                    // console.log("data.buff_type::",data.buff_type)
                     let box_p = buff_info.node.parent.getComponent(UITransform).convertToNodeSpaceAR(data.pos)
                     switch (data.buff_type) {
                         case config.buff_type.dun:
@@ -335,13 +335,13 @@ export class car extends Component {
       
     }
 
-    public buff_dun(){
+    public buff_dun(time:number =null){
         this.addSpeedNum(tools.game_config.buff_dun_add_speed+this.mCarData.attribute.n_shield_cd)
         // Tween.stopAllByTarget(this.game_manager.getBuffShowView().getBuffDun())
         // this.cancelScheduleBuffDun()
         // tween(this.game_manager.getBuffShowView().getBuffDun()).delay(tools.game_config.buff_dun).call(this.cancelScheduleBuffDun.bind(this)).start()
         // this.scheduleOnce(this.cancelScheduleBuffDun.bind(this),tools.game_config.buff_dun)
-        this.game_manager.getBuffShowView().showBuffDun(this.cancelScheduleBuffDun.bind(this),tools.game_config.buff_dun)  
+        this.game_manager.getBuffShowView().showBuffDun(this.cancelScheduleBuffDun.bind(this),time!=null?time:tools.game_config.buff_dun)  
         audioManager.Instance().playSound(config.AUDIO.buff_dun)
         this.spr.getComponent(buff_manager).updateStatus(config.SHOW_BUFF_STATUS.DUN)
         this.buff_dun_status = true;
@@ -364,6 +364,13 @@ export class car extends Component {
     public startGame(){
         this.isStartGame = true
         this.smoke_particle.node.active = true
+        if(this.mCarData.attribute.k_sprint_cd>0){
+            this.k_sprint_cd()
+        }
+    }
+
+    public k_sprint_cd(){
+        this.buff_dun(this.mCarData.attribute.k_sprint_cd)
     }
     public stopGame(){
         this.smoke_particle.node.active = false