xx 1 jaar geleden
bovenliggende
commit
0ae8cafe6b

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

@@ -12,7 +12,7 @@ export class cheyin_manager extends Component {
     private COUNT:number = 6
     private old_pos:Vec3 = Vec3.ZERO
     private new_pos:Vec3 = Vec3.ZERO
-    private delay_time:number = 0.1
+    private delay_time:number = 0.05
     private delay_count:number = 0
     private mCar:car = null
     private start_check:boolean = false

+ 24 - 15
assets/script/game/effect/weiqi_item.ts

@@ -5,26 +5,29 @@ const { ccclass, property } = _decorator;
 @ccclass('weiqi_item')
 export class weiqi_item extends Component {
     private mDur:number = 0
+    private old_pos:Vec3 = null
     public init(){
         this.hide()
     }
     public play(duration: number){
         this.mDur = duration
+
         if(this.node.parent!=null){
-        // let dir = this.node.parent.getComponent(weiqi_manager).getDir()
-        this.node.position = this.node.parent.getComponent(weiqi_manager).getOriginPos()
-        // let nor = pos.subtract(dir).normalize()
-        // let ndir = nor.multiplyScalar(dis)
-        this.show()
-        tween(this.node).delay(duration).call(()=>{
-            this.hide()
-            this.play(this.mDur)
-        })
-        // .to(duration,{position:dir}).call(()=>{
-        //     this.hide()
-        //     this.play(this.mDur)
-        // })
-        .start()
+            // let dir = this.node.parent.getComponent(weiqi_manager).getDir()
+            this.old_pos =this.node.parent.getComponent(weiqi_manager).getOriginPos()
+            this.node.position = new Vec3(this.old_pos.x,this.old_pos.y)
+            // let nor = pos.subtract(dir).normalize()
+            // let ndir = nor.multiplyScalar(dis)
+            tween(this.node).delay(duration).call(()=>{
+                this.show()
+                this.old_pos=null
+                this.play(this.mDur)
+            })
+            // .to(duration,{position:dir}).call(()=>{
+            //     this.hide()
+            //     this.play(this.mDur)
+            // })
+            .start()
         }
     }
 
@@ -41,7 +44,13 @@ export class weiqi_item extends Component {
     }
 
     protected update(dt: number): void {
-        this.node.position = new Vec3(this.node.position.x,this.node.position.y-dt*200)
+        if(this.old_pos!=null){
+            this.node.position = new Vec3(this.node.position.x,this.node.position.y-dt*200)
+            if(Vec3.distance(this.node.position,this.old_pos)>150){
+                this.hide()
+            }
+        }
+      
     }
 
 }

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

@@ -7,7 +7,7 @@ const { ccclass, property } = _decorator;
 export class weiqi_manager extends Component {
     @property(Prefab) weiqi_pf:Prefab = null
     private mCar:car = null
-    private COUNT:number = 16
+    private COUNT:number = 10
     public init(car:car){
         this.mCar = car
         this.node.removeAllChildren()
@@ -36,7 +36,7 @@ export class weiqi_manager extends Component {
     public startEffect(){
         for (let index = 0; index < this.node.children.length; index++) {
             const node = this.node.children[index];
-            node.getComponent(weiqi_item).play(index*0.2)
+            node.getComponent(weiqi_item).play(index*0.1)
         }
     }
 

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

@@ -174,8 +174,8 @@ export class game extends Component {
          }
         item.position = new Vec3(0,this.mHeight)
         this.mHeight+=m_d.height
-        this.car.setSiblingIndex(this.content.children.length)
         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))
     }