Преглед на файлове

添加 抽卡动画特效

zhengniehua преди 5 години
родител
ревизия
579288760b

+ 30 - 0
tower_sanguo/assets/MOKA/util/Utils.ts

@@ -365,6 +365,36 @@ export class Utils {
         //return { h: hour, m: minute, s: second };
     }
 
+    /**
+     * 物体震动
+    */
+    static ScreenShock(node: cc.Node, duration: number, callback: Function = null) {
+        let pos: cc.Vec2;
+        pos = cc.v2(node.x, node.y);
+
+        node.runAction(
+            cc.repeatForever(
+                cc.sequence(
+                    cc.moveTo(0.02, cc.v2(pos.x + 5, pos.y + 7)),
+                    cc.moveTo(0.02, cc.v2(pos.x + -6, pos.y + 7)),
+                    cc.moveTo(0.02, cc.v2(pos.x + -13, pos.y + 3)),
+                    cc.moveTo(0.02, cc.v2(pos.x + 3, pos.y + -6)),
+                    cc.moveTo(0.02, cc.v2(pos.x + -5, pos.y + 5)),
+                    cc.moveTo(0.02, cc.v2(pos.x + 2, pos.y + -8)),
+                    cc.moveTo(0.02, cc.v2(pos.x + -8, pos.y + -10)),
+                    cc.moveTo(0.02, cc.v2(pos.x + 3, pos.y + 10)),
+                    cc.moveTo(0.02, cc.v2(pos.x + 0, pos.y + 0))
+                )
+            )
+        );
+
+        setTimeout(() => {
+            node.stopAllActions();
+            node.setPosition(pos);
+            callback && callback();
+        }, duration * 1000);
+    }
+
     public static GetTimeLeft2BySecond(s: number): string {
         let hours = Math.round((s - 30 * 60) / (60 * 60));
         let minutes = Math.round((s - 30) / 60) % 60;

+ 29 - 0
tower_sanguo/assets/resources/animation/drawLight.anim

@@ -0,0 +1,29 @@
+{
+  "__type__": "cc.AnimationClip",
+  "_name": "drawLight",
+  "_objFlags": 0,
+  "_native": "",
+  "_duration": 2,
+  "sample": 30,
+  "speed": 1,
+  "wrapMode": 2,
+  "curveData": {
+    "props": {
+      "opacity": [
+        {
+          "frame": 0,
+          "value": 0
+        },
+        {
+          "frame": 1,
+          "value": 255
+        },
+        {
+          "frame": 2,
+          "value": 0
+        }
+      ]
+    }
+  },
+  "events": []
+}

+ 5 - 0
tower_sanguo/assets/resources/animation/drawLight.anim.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "2.1.0",
+  "uuid": "7084d7fa-37f4-496d-9610-8544f0638951",
+  "subMetas": {}
+}

Файловите разлики са ограничени, защото са твърде много
+ 258 - 126
tower_sanguo/assets/resources/module/drawRecruit/drawGeneral.prefab


+ 9 - 486
tower_sanguo/assets/resources/module/drawRecruit/drawRecruit.prefab

@@ -14,7 +14,7 @@
   {
     "__type__": "cc.Node",
     "_name": "drawRecruit",
-    "_objFlags": 512,
+    "_objFlags": 0,
     "_parent": null,
     "_children": [
       {
@@ -52,31 +52,19 @@
       },
       {
         "__id__": 96
-      },
-      {
-        "__id__": 150
-      },
-      {
-        "__id__": 153
-      },
-      {
-        "__id__": 156
-      },
-      {
-        "__id__": 159
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 162
+        "__id__": 150
       },
       {
-        "__id__": 163
+        "__id__": 151
       }
     ],
     "_prefab": {
-      "__id__": 164
+      "__id__": 152
     },
     "_opacity": 255,
     "_color": {
@@ -2708,10 +2696,10 @@
     ],
     "paused": false,
     "defaultSkin": "default",
-    "defaultAnimation": "animation",
+    "defaultAnimation": "",
     "_preCacheMode": 0,
     "_cacheMode": 0,
-    "loop": true,
+    "loop": false,
     "premultipliedAlpha": true,
     "timeScale": 1,
     "_accTime": 0,
@@ -5492,474 +5480,6 @@
     "sync": false
   },
   {
-    "__type__": "cc.Node",
-    "_name": "zise",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 151
-      }
-    ],
-    "_prefab": {
-      "__id__": 152
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        -209.244,
-        249.843,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "sp.Skeleton",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 150
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
-      }
-    ],
-    "paused": false,
-    "defaultSkin": "default",
-    "defaultAnimation": "animation",
-    "_preCacheMode": 0,
-    "_cacheMode": 0,
-    "loop": true,
-    "premultipliedAlpha": true,
-    "timeScale": 1,
-    "_accTime": 0,
-    "_playCount": 0,
-    "_frameCache": null,
-    "_curFrame": null,
-    "_skeletonCache": null,
-    "_animationName": "animation",
-    "_animationQueue": [],
-    "_headAniInfo": null,
-    "_playTimes": 0,
-    "_isAniComplete": true,
-    "_N$skeletonData": {
-      "__uuid__": "628f3d04-87e3-48cf-873d-012bfe451db1"
-    },
-    "_N$_defaultCacheMode": 0,
-    "_N$debugSlots": false,
-    "_N$debugBones": false,
-    "_N$debugMesh": false,
-    "_N$useTint": false,
-    "_N$enableBatch": false,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "bcc41a24-73d7-4017-9758-bec528bf7aa8"
-    },
-    "fileId": "0bSDI9xMdB3r10Md+NMdoC",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "xuneng",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 154
-      }
-    ],
-    "_prefab": {
-      "__id__": 155
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 290.95,
-      "height": 357.67
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        -202.998,
-        -12.492,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "sp.Skeleton",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 153
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
-      }
-    ],
-    "paused": false,
-    "defaultSkin": "default",
-    "defaultAnimation": "animation",
-    "_preCacheMode": 0,
-    "_cacheMode": 0,
-    "loop": true,
-    "premultipliedAlpha": true,
-    "timeScale": 1,
-    "_accTime": 0,
-    "_playCount": 0,
-    "_frameCache": null,
-    "_curFrame": null,
-    "_skeletonCache": null,
-    "_animationName": "animation",
-    "_animationQueue": [],
-    "_headAniInfo": null,
-    "_playTimes": 0,
-    "_isAniComplete": true,
-    "_N$skeletonData": {
-      "__uuid__": "97ad66c7-62ce-406a-b644-59892045a49e"
-    },
-    "_N$_defaultCacheMode": 0,
-    "_N$debugSlots": false,
-    "_N$debugBones": false,
-    "_N$debugMesh": false,
-    "_N$useTint": false,
-    "_N$enableBatch": false,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "bcc41a24-73d7-4017-9758-bec528bf7aa8"
-    },
-    "fileId": "1bKziydB1Ljo/An260DQdB",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "boom",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 157
-      }
-    ],
-    "_prefab": {
-      "__id__": 158
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        0,
-        0,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "sp.Skeleton",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 156
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
-      }
-    ],
-    "paused": false,
-    "defaultSkin": "default",
-    "defaultAnimation": "animation",
-    "_preCacheMode": 0,
-    "_cacheMode": 0,
-    "loop": true,
-    "premultipliedAlpha": true,
-    "timeScale": 1,
-    "_accTime": 0,
-    "_playCount": 0,
-    "_frameCache": null,
-    "_curFrame": null,
-    "_skeletonCache": null,
-    "_animationName": "animation",
-    "_animationQueue": [],
-    "_headAniInfo": null,
-    "_playTimes": 0,
-    "_isAniComplete": true,
-    "_N$skeletonData": {
-      "__uuid__": "0cd50f9b-1277-478e-b7d2-af81f8090ba0"
-    },
-    "_N$_defaultCacheMode": 0,
-    "_N$debugSlots": false,
-    "_N$debugBones": false,
-    "_N$debugMesh": false,
-    "_N$useTint": false,
-    "_N$enableBatch": false,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "bcc41a24-73d7-4017-9758-bec528bf7aa8"
-    },
-    "fileId": "bctRKcVbBGs64/z3RSPoG0",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "star",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 160
-      }
-    ],
-    "_prefab": {
-      "__id__": 161
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        249.843,
-        0,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "sp.Skeleton",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 159
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
-      }
-    ],
-    "paused": false,
-    "defaultSkin": "default",
-    "defaultAnimation": "animation",
-    "_preCacheMode": 0,
-    "_cacheMode": 0,
-    "loop": true,
-    "premultipliedAlpha": true,
-    "timeScale": 1,
-    "_accTime": 0,
-    "_playCount": 0,
-    "_frameCache": null,
-    "_curFrame": null,
-    "_skeletonCache": null,
-    "_animationName": "animation",
-    "_animationQueue": [],
-    "_headAniInfo": null,
-    "_playTimes": 0,
-    "_isAniComplete": true,
-    "_N$skeletonData": {
-      "__uuid__": "d9517168-3ecc-4368-9ef6-27a75ca6b928"
-    },
-    "_N$_defaultCacheMode": 0,
-    "_N$debugSlots": false,
-    "_N$debugBones": false,
-    "_N$debugMesh": false,
-    "_N$useTint": false,
-    "_N$enableBatch": false,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__uuid__": "bcc41a24-73d7-4017-9758-bec528bf7aa8"
-    },
-    "fileId": "04udp6LkxA76UTwRZYDjlR",
-    "sync": false
-  },
-  {
     "__type__": "cc.Widget",
     "_name": "",
     "_objFlags": 0,
@@ -6025,6 +5545,9 @@
     "img_wish_camp": {
       "__id__": 92
     },
+    "spine_light": {
+      "__id__": 71
+    },
     "txt_cost_one": {
       "__id__": 109
     },

Файловите разлики са ограничени, защото са твърде много
+ 160 - 636
tower_sanguo/assets/scenes/Test_Znh.fire


+ 38 - 0
tower_sanguo/assets/scripts/module/drawRecruit/DrawGeneralUI.ts

@@ -59,6 +59,8 @@ export default class DrawGeneralUI extends BaseUI {
     isOpenAll: boolean = false;
 
     isCanClick: boolean = true;     //暂时没用
+    //测试翻牌动画
+    private isTestAni = true;
 
     onLoad() {
         GameController.gameData.player.addComponent(this, PLAYERPROP.YB);
@@ -131,6 +133,7 @@ export default class DrawGeneralUI extends BaseUI {
     async openDraw_Ten() {
         this.isCanClick = false;
         let draw_data = this.ui_data.draw_data;
+        await Time.WaitForSeconds(0.5);
         for (let i = 0; cc.isValid(this) && i < this.drawItem_tens.length; i++) {
             if (!this.isOpenAll) {
                 let general = GameController.gameData.getGeneralByID(draw_data[i].id);// DrawRecruitModel.Ins.getAGeneral();
@@ -163,6 +166,18 @@ export default class DrawGeneralUI extends BaseUI {
 
     click_Draw_OneBtn() {
         this.drawItem_one.init();
+
+        //TEST
+        if(this.isTestAni){
+            let tempData = [
+                { id: 113009, type: 11, num: 1 }
+            ];
+            DrawRecruitModel.Ins.addDrawResultData(tempData);
+            this.ui_data = { type: 1, draw_data: tempData };
+            this.initPanelOne();
+            return;
+        }
+
         if (DrawRecruitModel.Ins.isCanDrawGeneral(1)) {
             GameController.http.drawCard((data) => {
                 console.log("--Data DrawCard UI 1: ", data);
@@ -203,6 +218,29 @@ export default class DrawGeneralUI extends BaseUI {
         for (let t of this.drawItem_tens) {
             t.init();
         }
+
+        //TEST
+        if(this.isTestAni){
+            let tempData = [
+                { id: 111004, type: 11, num: 1 },
+                { id: 111003, type: 11, num: 1 },
+                { id: 112005, type: 11, num: 1 },
+                { id: 112006, type: 11, num: 1 },
+                { id: 112007, type: 11, num: 1 },
+                { id: 112008, type: 11, num: 1 },
+                { id: 113009, type: 11, num: 1 },
+                { id: 113010, type: 11, num: 1 },
+                { id: 113011, type: 11, num: 1 },
+                { id: 113012, type: 11, num: 1 }
+            ];
+            DrawRecruitModel.Ins.addDrawResultData(tempData);
+            this.ui_data = { type: 2, draw_data: tempData };
+            this.openDraw_Ten();
+            this.panelTen_start.active = true;
+            this.panelTen_end.active = false;
+            return;
+        }
+
         if (DrawRecruitModel.Ins.isCanDrawGeneral(2)) {
             GameController.http.drawCard((data) => {
                 console.log("--Data DrawCard UI 10: ", data);

+ 59 - 29
tower_sanguo/assets/scripts/module/drawRecruit/DrawItem.ts

@@ -1,4 +1,5 @@
 import Time from "../../../MOKA/util/Time";
+import { Utils } from "../../../MOKA/util/Utils";
 import GeneralVO from "../../vo/GeneralVO";
 
 const { ccclass, property } = cc._decorator;
@@ -17,6 +18,8 @@ export default class DrawItem extends cc.Component {
 
     @property({ type: cc.Sprite, displayName: "图_背光" })
     img_light: cc.Sprite = null;
+    @property({ type: cc.Sprite, displayName: "图_背光开_先显示" })
+    img_light_before: cc.Sprite = null;
     @property({ type: cc.Sprite, displayName: "图_背光开" })
     img_light_opened: cc.Sprite = null;
 
@@ -54,9 +57,11 @@ export default class DrawItem extends cc.Component {
     @property({ type: sp.Skeleton, displayName: "动画_高品质3" })
     spine_best3: sp.Skeleton = null;
 
+    private initPos: cc.Vec2 = cc.v2();
     isOpened = false;
 
     onLoad() {
+        this.initPos = this.node.getPosition();
         this.init();
     }
 
@@ -64,11 +69,13 @@ export default class DrawItem extends cc.Component {
         this.isOpened = false;
         cc.Tween.stopAllByTarget(this.btn_open);
         cc.Tween.stopAllByTarget(this.node_opened);
+        this.node.setPosition(this.initPos);
         this.btn_open.scaleX = 1;
         this.node_opened.scaleX = 0;
         this.node_opened.active = false;
         this.img_camp.node.active = false;
         this.node_hasHero.active = false;
+        this.img_light_before.node.active = false;
 
         this.spine_zi.node.active = false;
         this.spine_best1.node.active = false;
@@ -95,12 +102,12 @@ export default class DrawItem extends cc.Component {
 
             if (general.color == 1) {
                 cc.tween(this.btn_open)
-                    .to(0.2, { scaleX: 0 })
+                    .to(0.25, { scaleX: 0 })
                     .call(() => {
                         this.node_opened.active = true;
 
                         cc.tween(this.node_opened)
-                            .to(0.2, { scaleX: 1 })
+                            .to(0.25, { scaleX: 1 })
                             .call(() => {
                                 this.img_camp.node.active = true;
 
@@ -166,16 +173,14 @@ export default class DrawItem extends cc.Component {
     */
     async playAni(type: number, isSlice: boolean, num: number) {
         if (type == 1) {
-            this.spine_zi.node.active = true;
-            this.spine_zi.setAnimation(0, "animation", false);
 
             cc.tween(this.btn_open)
-                .to(0.2, { scaleX: 0 })
+                .to(0.25, { scaleX: 0 })
                 .call(() => {
                     this.node_opened.active = true;
 
                     cc.tween(this.node_opened)
-                        .to(0.2, { scaleX: 1 })
+                        .to(0.25, { scaleX: 1 })
                         .call(() => {
                             this.img_camp.node.active = true;
 
@@ -184,47 +189,72 @@ export default class DrawItem extends cc.Component {
                             this.txt_slice.string = "x" + num;
                         })
                         .start();
+                    this.playZiAni();
                 })
                 .start();
 
-            await Time.WaitForSeconds(this.spine_zi.findAnimation("animation").duration + 0.1);
-            if (cc.isValid(this.node)) {
-                this.spine_zi.node.active = false;
-            }
+
         } else {
-            this.spine_best1.node.active = true;
-            this.spine_best1.setAnimation(0, "animation", true);
-            await Time.WaitForSeconds(this.spine_best1.findAnimation("animation").duration + 1);
-            this.spine_best1.node.active = false;
-            this.spine_best2.node.active = true;
-            this.spine_best2.setAnimation(0, "animation", false);
+            this.img_light.node.active = false;
+            this.img_light_before.node.active = true;
 
-            cc.tween(this.btn_open)
-                .to(0.2, { scaleX: 0 })
+            cc.tween(this.node)
+                .to(0.4, { position: cc.v2(this.node.x, this.node.y + 30) })
                 .call(() => {
-                    this.node_opened.active = true;
+                    this.playBest1Ani();
+                    Utils.ScreenShock(this.node, 1.5, () => {
+                        if (!cc.isValid(this.node)) return;
+                        this.spine_best1.node.active = false;
+                        this.spine_best2.node.active = true;
+                        this.spine_best2.setAnimation(0, "animation", false);
+
+                        cc.tween(this.btn_open)
+                            .to(0.25, { scaleX: 0 })
+                            .call(() => {
+                                this.node_opened.active = true;
 
-                    cc.tween(this.node_opened)
-                        .to(0.2, { scaleX: 1 })
-                        .call(() => {
-                            this.img_camp.node.active = true;
+                                cc.tween(this.node_opened)
+                                    .to(0.25, { scaleX: 1 })
+                                    .call(() => {
+                                        this.img_camp.node.active = true;
 
-                            //碎片判断 是否已拥有该武将
-                            this.node_hasHero.active = isSlice;
-                            this.txt_slice.string = "x" + num;
+                                        //碎片判断 是否已拥有该武将
+                                        this.node_hasHero.active = isSlice;
+                                        this.txt_slice.string = "x" + num;
 
-                            this.playAniCard();
-                        })
-                        .start();
+                                        this.playAniCard();
+                                    })
+                                    .start();
+                            })
+                            .start();
+                    });
                 })
                 .start();
+
+
         }
     }
 
+    async playZiAni() {
+        this.spine_zi.node.active = true;
+        this.spine_zi.setAnimation(0, "animation", false);
+        await Time.WaitForSeconds(this.spine_zi.findAnimation("animation").duration + 0.1);
+        if (cc.isValid(this.node)) {
+            this.spine_zi.node.active = false;
+        }
+    }
+
+    async playBest1Ani() {
+        this.spine_best1.node.active = true;
+        this.spine_best1.setAnimation(0, "animation", true);
+        await Time.WaitForSeconds(this.spine_best1.findAnimation("animation").duration + 1);
+    }
+
     async playAniCard() {
         this.spine_best3.node.active = true;
         this.spine_best3.setAnimation(0, "animation", false);
         await Time.WaitForSeconds(this.spine_best3.findAnimation("animation").duration + 0.1);
+        if (!cc.isValid(this.node)) return;
         this.spine_best3.node.active = false;
     }
 }

+ 39 - 0
tower_sanguo/assets/scripts/module/drawRecruit/DrawRecruitUI.ts

@@ -36,6 +36,9 @@ export default class DrawRecruitUI extends BaseUI {
     @property({ type: cc.Sprite, displayName: '图_心愿武将阵营' })
     img_wish_camp: cc.Sprite = null;
 
+    @property({ type: sp.Skeleton, displayName: 'Spine_光条特效动画' })
+    spine_light: sp.Skeleton = null;
+
     @property({ type: cc.Label, displayName: '文本_单抽消耗' })
     txt_cost_one: cc.Label = null;
 
@@ -45,6 +48,10 @@ export default class DrawRecruitUI extends BaseUI {
     @property({ type: cc.Label, displayName: '文本_十连抽原价消耗' })
     txt_cost_ten_old: cc.Label = null;
 
+
+    //测试翻牌动画
+    private isTestAni = true;
+
     onLoad() {
         XXEvent.on("updateWishInfo", this.updateWishInfo, this);
 
@@ -88,6 +95,7 @@ export default class DrawRecruitUI extends BaseUI {
                 if (errr) { return; }
                 this.img_wish_camp.spriteFrame = asset;
             });
+            this.spine_light.setAnimation(0, "animation", false);
         }
         else {
             this.img_wish.spriteFrame = null;
@@ -111,6 +119,16 @@ export default class DrawRecruitUI extends BaseUI {
         //if (GameController.gameData.player.generals_bag != null)
         //    GameController.uiM.openUI(DrawGeneralUI, null, ViewZorder.UI, null, null, { type: 1 });
 
+        //TEST
+        if(this.isTestAni){
+            let tempData = [
+                { id: 113009, type: 11, num: 1 }
+            ];
+            DrawRecruitModel.Ins.addDrawResultData(tempData);
+            GameController.uiM.openUI(DrawGeneralUI, null, ViewZorder.UI, null, null, { type: 1, draw_data: tempData });
+            return;
+        }
+
         if (DrawRecruitModel.Ins.isCanDrawGeneral(1)) {
             GameController.http.drawCard((data) => {
                 console.log("--Data DrawCard 1: ", data);
@@ -141,6 +159,27 @@ export default class DrawRecruitUI extends BaseUI {
 
     click_DrawTenBtn() {
         GameController.audioM.playEffect(AUDIO_TYPE.button);
+
+        //TEST
+        if(this.isTestAni){
+            let tempData = [
+                { id: 111004, type: 11, num: 1 },
+                { id: 111003, type: 11, num: 1 },
+                { id: 112005, type: 11, num: 1 },
+                { id: 112006, type: 11, num: 1 },
+                { id: 112007, type: 11, num: 1 },
+                { id: 112008, type: 11, num: 1 },
+                { id: 113009, type: 11, num: 1 },
+                { id: 113010, type: 11, num: 1 },
+                { id: 113011, type: 11, num: 1 },
+                { id: 113012, type: 11, num: 1 }
+            ];
+    
+            DrawRecruitModel.Ins.addDrawResultData(tempData);
+            GameController.uiM.openUI(DrawGeneralUI, null, ViewZorder.UI, null, null, { type: 2, draw_data: tempData });
+            return;
+        }
+
         //if (GameController.gameData.player.generals_bag != null)
         //    GameController.uiM.openUI(DrawGeneralUI, null, ViewZorder.UI, null, null, { type: 2 });
         if (DrawRecruitModel.Ins.isCanDrawGeneral(2)) {

+ 9 - 0
tower_sanguo/assets/scripts/module/drawRecruit/DrawResultUI.ts

@@ -27,6 +27,9 @@ export default class DrawResultUI extends BaseUI {
                 this.scrollView.enabled = false;
                 this.content.setPosition(cc.v2(0, 0));
                 console.log("-----");
+            } else {
+                let posx = (data.length * 110 + (data.length - 1) * 30) / 2 - 253;
+                this.content.setPosition(cc.v2(posx, 0));
             }
             for (let i = 0; i < data.length; i++) {
                 let scr = cc.instantiate(this.drawResultItem.node).getComponent(DrawResultItem);
@@ -42,4 +45,10 @@ export default class DrawResultUI extends BaseUI {
     onDestroy() {
         DrawRecruitModel.Ins.drawResults = null;
     }
+    /*
+    总半长:685
+    框宽:506
+    targetposx:685-253=432  总半长>框宽
+    150-253=-103
+    */
 }

Някои файлове не бяха показани, защото твърде много файлове са промени