xx 1 рік тому
батько
коміт
5dc47bb40c
2 змінених файлів з 4 додано та 2 видалено
  1. 1 1
      assets/resources/prefabs/game.prefab
  2. 3 1
      assets/script/game/box.ts

+ 1 - 1
assets/resources/prefabs/game.prefab

@@ -380,7 +380,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 206.541,
-      "y": -500,
+      "y": -300,
       "z": 0
     },
     "_lrot": {

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

@@ -55,6 +55,9 @@ export class box extends base {
                 let box_world=this.node.parent.getComponent(UITransform).convertToWorldSpaceAR(this.node.position)
                 let p = this.mCar.node.parent.getComponent(UITransform).convertToNodeSpaceAR(box_world)
                 this.mCar.getGame().showBoom(p)
+                if(isUseBuff){
+                    this.mData.pos = this.getWorldPos()
+                }
                 this.removeSelf()
                 isUseBuff = true
             }else{
@@ -65,7 +68,6 @@ export class box extends base {
 
             if(call!=null){
                 if(isUseBuff){
-                    this.mData.pos = this.getWorldPos()
                     call(this.mData,isKill,this.scores)
                 }else{
                     call()