Browse Source

Merge branch 'master' of http://120.92.132.192:23541/TDGame/TDGameClient3D

xujialiang 4 years ago
parent
commit
88b2d35bde

+ 34 - 0
assets/resources/configs/SuperWeapon.json

@@ -0,0 +1,34 @@
+[
+    {
+        "id": 1,
+        "weaponId": 11301
+    },
+    {
+        "id": 2,
+        "weaponId": 11401
+    },
+    {
+        "id": 3,
+        "weaponId": 11501
+    },
+    {
+        "id": 4,
+        "weaponId": 11601
+    },
+    {
+        "id": 5,
+        "weaponId": 11701
+    },
+    {
+        "id": 6,
+        "weaponId": 11801
+    },
+    {
+        "id": 7,
+        "weaponId": 11901
+    },
+    {
+        "id": 8,
+        "weaponId": 12001
+    }
+]

+ 5 - 1
assets/scripts/games/ui/exchanges/ExchangeItemRenderScript.ts

@@ -32,12 +32,15 @@ export class ExchangeItemRenderScript extends Component {
 
     private data: any;
 
+    private gold:number;
     UpdateItemRender(data: any): void {
         this.data = data;
         let time: number = data.time / 60 / 60;
+        this.gold=GameModel.single.fullEarnings * data.time;
+
         this.timeLabel.string = time + "小时枪械收益";
         this.timeLabel1.string = "立即获得" + time + "小时枪械收益!";
-        this.goldLabel.string = StringUtils.numberUtilsEn(GameModel.single.fullEarnings * data.time);
+        this.goldLabel.string = StringUtils.numberUtilsEn(this.gold);
         this.diamondLabel.string = StringUtils.numberUtilsEn(data.useDiamond, 0);
     }
 
@@ -49,6 +52,7 @@ export class ExchangeItemRenderScript extends Component {
             NoticeManager.ShowPrompt("钻石不足!");
         } else {
             GameModel.single.diamond -= this.data.useDiamond;
+            GameModel.single.gold+=this.gold;
             let weChat = PlatformManager.impl as WeChatPlatform;
             if (weChat instanceof WeChatPlatform) {
                 weChat.branchAnalytics(branchIdType.GoldExchange, String(this.data.useDiamond))