Quellcode durchsuchen

通关红包z字飘落动画

薛鸿潇 vor 5 Jahren
Ursprung
Commit
fce677a9da

+ 36 - 0
tower_sanguo/assets/scripts/module/checkpointRedBag/CheckpointRedBagItem.ts

@@ -30,6 +30,42 @@ export default class CheckpointRedBagItem extends cc.Component {
     start() {
         this.node_icon.active = false;
         this.hb520.active = true;
+        this.zFalling();
+    }
+    /** z字落地术 */
+    private zFalling() {
+        // z字三点式
+        let end_pos1 = this.node.getPosition();
+        let end_pos2 = this.node.getPosition();
+        let end_pos3 = this.node.getPosition();
+        // 左右坐标
+        if (this.node.x >= 0) {
+            // 在右边,左飘
+            end_pos1.x -= this.node.width * 3;
+            end_pos2.x -= this.node.width * 1;
+            end_pos3.x -= this.node.width * 2;
+        } else {
+            // 在左边,右飘
+            end_pos1.x += this.node.width * 3;
+            end_pos2.x += this.node.width * 1;
+            end_pos3.x += this.node.width * 2;
+        }
+        // 上下坐标
+        if (this.node.y <= -200) {
+            // 在下面
+            end_pos1.y += this.node.height / 1;
+            end_pos2.y += this.node.height * 1.5;
+            end_pos3.y += this.node.height * 2;
+        } else {
+            // 在上面
+            end_pos1.y -= this.node.height / 2;
+            end_pos2.y -= this.node.height;
+            end_pos3.y -= this.node.height * 1.2;
+        }
+        let pos1 = cc.tween().to(0.5, { position: end_pos1 })
+        let pos2 = cc.tween().to(0.5, { position: end_pos2 })
+        let pos3 = cc.tween().to(0.5, { position: end_pos3 })
+        cc.tween(this.node).then(pos1).then(pos2).then(pos3).start();
     }
     private flyNode() {
         if (this.anim_playing) return;

+ 2 - 0
tower_sanguo/塔防接口.md

@@ -1,3 +1,5 @@
+# swagger地址:
+- http://172.16.15.231:9092/swagger-ui/#/
 用户相关: 
 	updatePlayerProp:更新用户属性
 	入参: