Ver Fonte

升星界面动画

薛鸿潇 há 5 anos atrás
pai
commit
fd68aa3568

+ 101 - 0
tower_sanguo/assets/resources/module/generalUpStar/UpStarUIAnim.anim

@@ -0,0 +1,101 @@
+{
+  "__type__": "cc.AnimationClip",
+  "_name": "UpStarUIAnim",
+  "_objFlags": 0,
+  "_native": "",
+  "_duration": 0.16666666666666666,
+  "sample": 60,
+  "speed": 1,
+  "wrapMode": 1,
+  "curveData": {
+    "paths": {
+      "general_head_1": {
+        "props": {
+          "opacity": [
+            {
+              "frame": 0,
+              "value": 0
+            },
+            {
+              "frame": 0.16666666666666666,
+              "value": 255
+            }
+          ],
+          "x": [
+            {
+              "frame": 0,
+              "value": -200
+            },
+            {
+              "frame": 0.16666666666666666,
+              "value": -160
+            }
+          ]
+        }
+      },
+      "general_head_2": {
+        "props": {
+          "opacity": [
+            {
+              "frame": 0,
+              "value": 0
+            },
+            {
+              "frame": 0.16666666666666666,
+              "value": 255
+            }
+          ],
+          "x": [
+            {
+              "frame": 0,
+              "value": 0
+            },
+            {
+              "frame": 0.16666666666666666,
+              "value": 150
+            }
+          ]
+        }
+      },
+      "jiantou_head": {
+        "props": {
+          "opacity": [
+            {
+              "frame": 0,
+              "value": 0
+            },
+            {
+              "frame": 0.16666666666666666,
+              "value": 255
+            }
+          ],
+          "x": [
+            {
+              "frame": 0,
+              "value": -50
+            },
+            {
+              "frame": 0.16666666666666666,
+              "value": -9
+            }
+          ]
+        }
+      },
+      "node_value": {
+        "props": {
+          "opacity": [
+            {
+              "frame": 0,
+              "value": 0
+            },
+            {
+              "frame": 0.16666666666666666,
+              "value": 255
+            }
+          ]
+        }
+      }
+    }
+  },
+  "events": []
+}

+ 5 - 0
tower_sanguo/assets/resources/module/generalUpStar/UpStarUIAnim.anim.meta

@@ -0,0 +1,5 @@
+{
+  "ver": "2.1.0",
+  "uuid": "2557924f-eef6-4cfa-a9f5-607c96fd9d3a",
+  "subMetas": {}
+}

Diff do ficheiro suprimidas por serem muito extensas
+ 307 - 295
tower_sanguo/assets/resources/module/generalUpStar/general_up_star.prefab


+ 9 - 4
tower_sanguo/assets/scripts/module/general/GeneralInfoUI.ts

@@ -227,8 +227,6 @@ export default class GeneralInfoUI extends BaseUI {
             star: success_general.star,
             attack: new_attack,
         }
-        // 打开升星展示界面
-        GameController.uiM.openUI(GeneralUpStarUI, null, ViewZorder.UI, null, null, { old_data: old_general, new_data: new_general })
 
         // 更新背包数据
         let generals_bag = GameController.gameData.player.generals_bag
@@ -249,8 +247,15 @@ export default class GeneralInfoUI extends BaseUI {
         // 碎片进度 
         this.chipStyle();
         GameController.gameData.updateGeneral([this.general_data]);
-        //检测武将升级
-        MarshalSkillModel.Ins.checkGeneralUnlockOrLvUpData();
+        // //检测武将升级
+        // MarshalSkillModel.Ins.checkGeneralUnlockOrLvUpData();
+        let call1 = () => {
+            MarshalSkillModel.Ins.checkGeneralUnlockOrLvUpData();
+        }
+        // 打开升星展示界面
+        GameController.uiM.openUI(GeneralUpStarUI, null, ViewZorder.UI, null, null, {
+            old_data: old_general, new_data: new_general, close_call: call1
+        })
         cc.log('升星成功:%o', data)
     }
     /** 更换武将事件触发 

+ 29 - 9
tower_sanguo/assets/scripts/module/general/GeneralUpStarUI.ts

@@ -1,10 +1,6 @@
-// Learn TypeScript:
-//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
-// Learn Attribute:
-//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
-// Learn life-cycle callbacks:
-//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
-
+/**
+ * 5s自动关闭
+ */
 import BaseUI from "../../../MOKA/component/BaseUI";
 import GameController from "../../GameController";
 const { ccclass, property } = cc._decorator;
@@ -30,6 +26,11 @@ export default class GeneralUpStarUI extends BaseUI {
     private img_box_1: cc.Sprite = null!;
     @property({ type: cc.Sprite, displayName: '头像框2' })
     private img_box_2: cc.Sprite = null!;
+    /** 自动关闭时间 */
+    @property({ displayName: '自动关闭时间' })
+    private life_time: number = 5;
+    @property({ type: cc.Label, displayName: '自动关闭描述' })
+    private txt_time: cc.Label = null!;
 
     /** 数据 */
     private my_data = {
@@ -44,15 +45,20 @@ export default class GeneralUpStarUI extends BaseUI {
             fragment: 0,
             star: 0,
             attack: 0,
-        }
+        },
+        /** 关闭回调 */
+        close_call: null
     }
+    /** 当前时间s */
+    private cur_time = 0;
     onLoad() {
-
+        this.schedule(this.upTextClose, 1);
     }
 
     start() {
         this.my_data.old_data = this.ui_data.old_data;
         this.my_data.new_data = this.ui_data.new_data;
+        this.my_data.close_call = this.ui_data.close_call;
         cc.log(this.ui_data)
         this.initStyle();
     }
@@ -100,5 +106,19 @@ export default class GeneralUpStarUI extends BaseUI {
             this.img_box_2.spriteFrame = asset;
         })
     }
+    /** 关闭倒计时显示 */
+    private upTextClose() {
+        this.cur_time++;
+        if (this.cur_time >= this.life_time) {
+            this.unschedule(this.upTextClose);
+            this.close();
+        }
+        let gap = this.life_time - this.cur_time;
+        this.txt_time.string = gap + '秒后自动关闭';
+    }
+    onDestroy() {
+        this.my_data.close_call && this.my_data.close_call();
+        super.onDestroy()
+    }
     // update (dt) {}
 }

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff