Selaa lähdekoodia

Merge branch 'master' of http://git.mokasz.com/zouyong/team1_nc

# Conflicts:
#	assets/resources/game/prefab/game.prefab
#	assets/script/game/game/Game.ts
#	assets/script/mk/system/FlySystem.ts
#	assets/script/mk/system/FlySystem2.ts
#	build/jsb-link/assets/main/index.jsc
#	build/jsb-link/assets/resources/config.json
#	build/jsb-link/assets/resources/import/b4/b4dea4a9-29c8-46bc-a50d-5754afa7a2bd.json
#	build/jsb-link/frameworks/runtime-src/proj.android-studio/.idea/caches/build_file_checksums.ser
#	build/jsb-link/js backups (useful for debugging)/main.index.js
#	packages-hot-update/cfg.json
kaka 4 vuotta sitten
vanhempi
commit
55ce05732a

+ 0 - 12
assets/resources/animation/Main.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "8c65ee95-8d1e-4deb-8864-df1c7a01c9ee",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 2 - 2
assets/resources/module/farmMap/farmItem.prefab

@@ -658,7 +658,7 @@
         "__id__": 22
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 25
@@ -1722,7 +1722,7 @@
       "__id__": 1
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 47

+ 123 - 95
assets/resources/module/newNotice/newNotice.prefab

@@ -24,20 +24,20 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 63
+        "__id__": 65
       },
       {
-        "__id__": 64
+        "__id__": 66
       },
       {
-        "__id__": 65
+        "__id__": 67
       },
       {
-        "__id__": 66
+        "__id__": 68
       }
     ],
     "_prefab": {
-      "__id__": 67
+      "__id__": 69
     },
     "_opacity": 255,
     "_color": {
@@ -98,38 +98,38 @@
         "__id__": 3
       },
       {
-        "__id__": 7
+        "__id__": 8
       },
       {
-        "__id__": 16
+        "__id__": 17
       },
       {
-        "__id__": 19
+        "__id__": 20
       },
       {
-        "__id__": 28
+        "__id__": 29
       },
       {
-        "__id__": 34
+        "__id__": 35
       },
       {
-        "__id__": 40
+        "__id__": 41
       },
       {
-        "__id__": 46
+        "__id__": 47
       },
       {
-        "__id__": 52
+        "__id__": 53
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 61
+        "__id__": 63
       }
     ],
     "_prefab": {
-      "__id__": 62
+      "__id__": 64
     },
     "_opacity": 255,
     "_color": {
@@ -196,7 +196,7 @@
       }
     ],
     "_prefab": {
-      "__id__": 6
+      "__id__": 7
     },
     "_opacity": 255,
     "_color": {
@@ -289,10 +289,24 @@
       "__id__": 1
     },
     "transition_type": 0,
-    "onComplete": [],
+    "onComplete": [
+      {
+        "__id__": 6
+      }
+    ],
     "_id": ""
   },
   {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "0844bD2l/VN6IpaSUDaTsl4",
+    "handler": "clickCloseBtn",
+    "customEventData": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -312,20 +326,20 @@
     },
     "_children": [
       {
-        "__id__": 8
+        "__id__": 9
       },
       {
-        "__id__": 11
+        "__id__": 12
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 14
+        "__id__": 15
       }
     ],
     "_prefab": {
-      "__id__": 15
+      "__id__": 16
     },
     "_opacity": 255,
     "_color": {
@@ -379,17 +393,17 @@
     "_name": "logo",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 7
+      "__id__": 8
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 9
+        "__id__": 10
       }
     ],
     "_prefab": {
-      "__id__": 10
+      "__id__": 11
     },
     "_opacity": 255,
     "_color": {
@@ -443,7 +457,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 8
+      "__id__": 9
     },
     "_enabled": true,
     "_materials": [
@@ -486,17 +500,17 @@
     "_name": "标题文本",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 7
+      "__id__": 8
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 12
+        "__id__": 13
       }
     ],
     "_prefab": {
-      "__id__": 13
+      "__id__": 14
     },
     "_opacity": 255,
     "_color": {
@@ -550,7 +564,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 11
+      "__id__": 12
     },
     "_enabled": true,
     "_materials": [
@@ -594,7 +608,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 7
+      "__id__": 8
     },
     "_enabled": true,
     "_materials": [
@@ -643,11 +657,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 17
+        "__id__": 18
       }
     ],
     "_prefab": {
-      "__id__": 18
+      "__id__": 19
     },
     "_opacity": 255,
     "_color": {
@@ -701,7 +715,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 16
+      "__id__": 17
     },
     "_enabled": true,
     "_materials": [
@@ -749,20 +763,20 @@
     },
     "_children": [
       {
-        "__id__": 20
+        "__id__": 21
       },
       {
-        "__id__": 23
+        "__id__": 24
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 26
+        "__id__": 27
       }
     ],
     "_prefab": {
-      "__id__": 27
+      "__id__": 28
     },
     "_opacity": 255,
     "_color": {
@@ -816,17 +830,17 @@
     "_name": "New Label",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 19
+      "__id__": 20
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 21
+        "__id__": 22
       }
     ],
     "_prefab": {
-      "__id__": 22
+      "__id__": 23
     },
     "_opacity": 255,
     "_color": {
@@ -880,7 +894,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 20
+      "__id__": 21
     },
     "_enabled": true,
     "_materials": [
@@ -924,17 +938,17 @@
     "_name": "提现金额",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 19
+      "__id__": 20
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 24
+        "__id__": 25
       }
     ],
     "_prefab": {
-      "__id__": 25
+      "__id__": 26
     },
     "_opacity": 255,
     "_color": {
@@ -988,7 +1002,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 23
+      "__id__": 24
     },
     "_enabled": true,
     "_materials": [
@@ -1032,7 +1046,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 19
+      "__id__": 20
     },
     "_enabled": true,
     "_layoutSize": {
@@ -1079,17 +1093,17 @@
     },
     "_children": [
       {
-        "__id__": 29
+        "__id__": 30
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 32
+        "__id__": 33
       }
     ],
     "_prefab": {
-      "__id__": 33
+      "__id__": 34
     },
     "_opacity": 255,
     "_color": {
@@ -1143,17 +1157,17 @@
     "_name": "描述",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 28
+      "__id__": 29
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 30
+        "__id__": 31
       }
     ],
     "_prefab": {
-      "__id__": 31
+      "__id__": 32
     },
     "_opacity": 255,
     "_color": {
@@ -1207,7 +1221,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 29
+      "__id__": 30
     },
     "_enabled": true,
     "_materials": [
@@ -1251,7 +1265,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 28
+      "__id__": 29
     },
     "_enabled": true,
     "_materials": [
@@ -1298,17 +1312,17 @@
     },
     "_children": [
       {
-        "__id__": 35
+        "__id__": 36
       }
     ],
     "_active": false,
     "_components": [
       {
-        "__id__": 38
+        "__id__": 39
       }
     ],
     "_prefab": {
-      "__id__": 39
+      "__id__": 40
     },
     "_opacity": 255,
     "_color": {
@@ -1362,17 +1376,17 @@
     "_name": "描述",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 34
+      "__id__": 35
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 36
+        "__id__": 37
       }
     ],
     "_prefab": {
-      "__id__": 37
+      "__id__": 38
     },
     "_opacity": 255,
     "_color": {
@@ -1426,7 +1440,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 35
+      "__id__": 36
     },
     "_enabled": true,
     "_materials": [
@@ -1470,7 +1484,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 34
+      "__id__": 35
     },
     "_enabled": true,
     "_materials": [
@@ -1518,17 +1532,17 @@
     },
     "_children": [
       {
-        "__id__": 41
+        "__id__": 42
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 44
+        "__id__": 45
       }
     ],
     "_prefab": {
-      "__id__": 45
+      "__id__": 46
     },
     "_opacity": 255,
     "_color": {
@@ -1582,17 +1596,17 @@
     "_name": "描述",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 40
+      "__id__": 41
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 42
+        "__id__": 43
       }
     ],
     "_prefab": {
-      "__id__": 43
+      "__id__": 44
     },
     "_opacity": 255,
     "_color": {
@@ -1646,7 +1660,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 41
+      "__id__": 42
     },
     "_enabled": true,
     "_materials": [
@@ -1690,7 +1704,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 40
+      "__id__": 41
     },
     "_enabled": true,
     "_materials": [
@@ -1738,17 +1752,17 @@
     },
     "_children": [
       {
-        "__id__": 47
+        "__id__": 48
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 50
+        "__id__": 51
       }
     ],
     "_prefab": {
-      "__id__": 51
+      "__id__": 52
     },
     "_opacity": 255,
     "_color": {
@@ -1802,17 +1816,17 @@
     "_name": "描述",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 46
+      "__id__": 47
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 48
+        "__id__": 49
       }
     ],
     "_prefab": {
-      "__id__": 49
+      "__id__": 50
     },
     "_opacity": 255,
     "_color": {
@@ -1866,7 +1880,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 47
+      "__id__": 48
     },
     "_enabled": true,
     "_materials": [
@@ -1910,7 +1924,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 46
+      "__id__": 47
     },
     "_enabled": true,
     "_materials": [
@@ -1958,23 +1972,23 @@
     },
     "_children": [
       {
-        "__id__": 53
+        "__id__": 54
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 57
-      },
-      {
         "__id__": 58
       },
       {
         "__id__": 59
+      },
+      {
+        "__id__": 60
       }
     ],
     "_prefab": {
-      "__id__": 60
+      "__id__": 62
     },
     "_opacity": 255,
     "_color": {
@@ -2028,20 +2042,20 @@
     "_name": "描述",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 52
+      "__id__": 53
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 54
+        "__id__": 55
       },
       {
-        "__id__": 55
+        "__id__": 56
       }
     ],
     "_prefab": {
-      "__id__": 56
+      "__id__": 57
     },
     "_opacity": 255,
     "_color": {
@@ -2095,7 +2109,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 53
+      "__id__": 54
     },
     "_enabled": true,
     "_materials": [
@@ -2130,7 +2144,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 53
+      "__id__": 54
     },
     "_enabled": true,
     "_color": {
@@ -2159,7 +2173,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 52
+      "__id__": 53
     },
     "_enabled": true,
     "_materials": [
@@ -2191,7 +2205,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 52
+      "__id__": 53
     },
     "_enabled": true,
     "_normalMaterial": null,
@@ -2259,17 +2273,31 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 52
+      "__id__": 53
     },
     "_enabled": true,
     "node_panel": {
       "__id__": 1
     },
     "transition_type": 3,
-    "onComplete": [],
+    "onComplete": [
+      {
+        "__id__": 61
+      }
+    ],
     "_id": ""
   },
   {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "0844bD2l/VN6IpaSUDaTsl4",
+    "handler": "clickCloseBtn",
+    "customEventData": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -2398,10 +2426,10 @@
     },
     "_enabled": true,
     "lbl_reward_value": {
-      "__id__": 24
+      "__id__": 25
     },
     "lbl_time": {
-      "__id__": 48
+      "__id__": 49
     },
     "_id": ""
   },

+ 1 - 0
assets/script/game/data/GameData.ts

@@ -1123,6 +1123,7 @@ class PlayerProp {
         gData.gameData.init_coin = true;
         //gData.gameData.init_red_point = true;
         gData.gameData.init_wallet_redMoney = true;
+        mk.ui.invokeRefreshEventByName("refreshCoin");
     }
     get redMoney(): number {
         return this._redMoney;

+ 19 - 11
assets/script/game/game/AniControl.ts

@@ -267,37 +267,45 @@ export default class AniControl extends cc.Component {
 
         let add = response.data.redMoneyAddition;
         console.log('addCoin===============>', add);
-        if(add > 0)
-        {
+        if (add > 0) {
             const several = 3;
             let intV = Math.floor(add / several);
             let r = add % several;
-    
+
             mk.audio.playEffect('redmoney');
             if (type == 'bird_1') {
-                for (let i = 0; i != several; ++i) {
-                    mk.fly.PlayCoinAnim(1, 1, this.flyBird_1.node, '', null, -1, intV);
+                if (intV > 0) {
+                    for (let i = 0; i != several; ++i) {
+                        mk.fly.PlayCoinAnim(1, 1, this.flyBird_1.node, '', null, -1, intV);
+                    }
                 }
+
                 if (r > 0) {
                     mk.fly.PlayCoinAnim(1, 1, this.flyBird_1.node, '', null, -1, r);
                 }
             } else if (type == 'bird_2') {
-                for (let i = 0; i != several; ++i) {
-                    mk.fly.PlayCoinAnim(1, 1, this.flyBird_2.node, '', null, -1, intV);
+                if (intV > 0) {
+                    for (let i = 0; i != several; ++i) {
+                        mk.fly.PlayCoinAnim(1, 1, this.flyBird_2.node, '', null, -1, intV);
+                    }
                 }
-    
+
                 if (r > 0) {
                     mk.fly.PlayCoinAnim(1, 1, this.flyBird_2.node, '', null, -1, r);
                 }
             } else if (type == 'dog') {
-                for (let i = 0; i != several; ++i) {
-                    mk.fly.PlayCoinAnim(1, 1, this.dogMove.node, '', null, -1, intV);
+                if(intV > 0)
+                {
+                    for (let i = 0; i != several; ++i) {
+                        mk.fly.PlayCoinAnim(1, 1, this.dogMove.node, '', null, -1, intV);
+                    }
                 }
+                
                 if (r > 0) {
                     mk.fly.PlayCoinAnim(1, 1, this.dogMove.node, '', null, -1, r);
                 }
             }
         }
-        
+
     }
 }

+ 7 - 3
assets/script/game/game/Farmer.ts

@@ -64,13 +64,17 @@ export class Farmer extends cc.Component {
         console.log('addCoinByFarmer===============>', add);
         if(add > 0)
         {
-            const several = 3;
+            const several = 2;
             let intV = Math.floor(add / several);
             let r = add % several;
             mk.audio.playEffect('redmoney');
-            for (let i = 0; i != several; ++i) {
-                mk.fly.PlayCoinAnim(1, 1, this.fly_node, '', null, -1, intV);
+            if(intV > 0)
+            {
+                for (let i = 0; i != several; ++i) {
+                    mk.fly.PlayCoinAnim(1, 1, this.fly_node, '', null, -1, intV);
+                }
             }
+            
             if (r > 0) {
                 mk.fly.PlayCoinAnim(1, 1, this.fly_node, '', null, -1, r);
             }

+ 2 - 2
assets/script/game/game/Game.ts

@@ -163,7 +163,7 @@ export default class Game extends cc.Component {
         }
     }
     lateUpdate() {
-        gData.gameData.init_head = false;
+        gData.gameData.init_head = false;     
     }
 
     private initMusic() {
@@ -205,7 +205,7 @@ export default class Game extends cc.Component {
         //this.lbl_redMoney.node.getComponent(mk.component.numberAnim).setValue(gData.gameData.playerProp.redMoney);
         cc.tween(this.lbl_redMoney.node).to(0.1, { scale: 1.2 }).to(0.05, { scale: 1 }).start();
         this.lbl_redMoney.string = gData.gameData.playerProp.redMoney / 100 + "";
-        gData.gameData.init_coin = false;
+        gData.gameData.init_coin = false;    
     }
 
     private async initHead() {

+ 6 - 5
assets/script/game/module/farmMap/FarmItem.ts

@@ -47,11 +47,10 @@ export default class FarmItem extends cc.Component {
 
         let max = gData.farmMapData.maxUnluckValue;
         if (data.picture <= max) {
-            this.sp_icon.spriteFrame = await mk.loader.load(plantPath + data.picture, cc.SpriteFrame);
             this.lbl_nameDes.node.active = true;
             this.lbl_nameDes.string = `${data.name} ${data.time}秒成熟`;
             this.lbl_des.string = `最高收获${data.menuRedBagCoin/100}红包币`;
-
+            
             let state = gData.gameData.getFarmMapRewardState(this.getIndex());
             if (state == 1) {
                 this.node_getBtn.active = true;
@@ -64,27 +63,29 @@ export default class FarmItem extends cc.Component {
                 this.node_unluckBtn.active = false;
                 this.node_redPoint.active = true;
             }
+            this.sp_icon.spriteFrame = await mk.loader.load(plantPath + data.picture, cc.SpriteFrame);
 
         } else if (data.picture - 1 == max) {
-            this.sp_icon.spriteFrame = await mk.loader.load('module/farmMap/texture/gift', cc.SpriteFrame);
             let times = gData.gameData.getProductMakeTimesById(data.picture - 1);
             let plantName = gData.gameData.getProductMap(data.picture - 1).name;
             let des = this.getDesByType();
             this.lbl_des.string = `${des}${this.data.value}次${plantName}后解锁\n(${times}/${data.value})`;;
-
+            
             this.node_getBtn.active = false;
             this.node_ungetBtn.active = false;
             this.node_unluckBtn.active = true;
             this.lbl_nameDes.node.active = false;
             this.node_redPoint.active = false;
-        } else {
             this.sp_icon.spriteFrame = await mk.loader.load('module/farmMap/texture/gift', cc.SpriteFrame);
+        } else {   
             this.lbl_des.string = "神秘物种,等待发现";
+            
             this.node_getBtn.active = false;
             this.node_ungetBtn.active = false;
             this.node_unluckBtn.active = true;
             this.lbl_nameDes.node.active = false;
             this.node_redPoint.active = false;
+            this.sp_icon.spriteFrame = await mk.loader.load('module/farmMap/texture/gift', cc.SpriteFrame);
         }
 
     }

+ 1 - 0
assets/script/game/module/newCashUI/NewCashUI.ts

@@ -1,3 +1,4 @@
+import { Data } from "../../../mk/data/Data";
 import JsbSystem from "../../../mk/system/JsbSystem";
 
 const { ccclass, property } = cc._decorator;

+ 1 - 1
assets/script/game/module/newCashUI/WalletCashOut.ts

@@ -126,7 +126,7 @@ export default class WalletCashOut extends cc.Component {
     private initTip() {
 
         this.lbl_redMoney.string = (gData.gameData.playerProp.redMoney/100).toString();
-        this.lbl_value.string = (gData.gameData.playerProp.redMoney / 1000000) + '元';
+        this.lbl_value.string = (gData.gameData.playerProp.redMoney / 1000000).toFixed(3) + '元';
 
         if (this.curChooseIndex != -1) {
             let data = gData.gameData.configs.CashCfg[this.curChooseIndex];

+ 1 - 1
assets/script/game/module/newNotice/NewNotice.ts

@@ -30,7 +30,7 @@ export default class NewNotice extends cc.Component {
     }
 
     private clickCloseBtn() {
-        mk.audio.playEffect("closeButton");
+        //mk.audio.playEffect("closeButton");
         gData.gameData.init_redBagTask = true;
     }
 }

+ 9 - 1
assets/script/game/module/newOpenRedBag/NewOpenRedBag.ts

@@ -37,7 +37,10 @@ export default class NewOpenRedBag extends cc.Component {
         this.showChangePart();
 
         this.initCashOutStyle(gData.gameData.playerProp.redMoney);
+        
+        mk.ui.registerRefreshEvent(this.node, this.initCashOutStyle.bind(this), "refreshCoin");
     }
+    
 
     showElectUI() {
         this.sendRecommendList();
@@ -71,6 +74,7 @@ export default class NewOpenRedBag extends cc.Component {
     }
 
     onDisable() {
+        mk.ui.removeRefreshEvent(this.node);
         mk.ad.destoryBanner();
     }
 
@@ -78,13 +82,17 @@ export default class NewOpenRedBag extends cc.Component {
      * 底部提现相关样式
      */
     private initCashOutStyle(redMoney: number = 0) {
+        if(redMoney == 0)
+        {
+            redMoney = gData.gameData.playerProp.redMoney;
+        }
         redMoney = redMoney/100;
         const cash_bar = gData.redBagCash.cash_bar;
         let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
         if (!cash_data) return;
         const newRedMoney = redMoney > cash_data.redMoney ? cash_data.redMoney : redMoney;
         this.lbl_reward_value.string = cash_data.money / 100 + '元';
-        this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney;
+        this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney/100;
         const fillRange = newRedMoney / cash_data.redMoney >= 1 ? 1 : newRedMoney / cash_data.redMoney;
         // this.spr_cash_out.fillRange = fillRange;
         cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();

+ 7 - 1
assets/script/game/module/redBagTask/RedBagTask.ts

@@ -69,6 +69,7 @@ export default class RedBagTask extends cc.Component {
 
 
         this.initCashOutStyle(gData.gameData.playerProp.redMoney);
+        mk.ui.registerRefreshEvent(this.node, this.initCashOutStyle.bind(this), "refreshCoin");
 
     }
 
@@ -88,6 +89,7 @@ export default class RedBagTask extends cc.Component {
     }
 
     onDisable() {
+        mk.ui.removeRefreshEvent(this.node);
         mk.ad.destoryBanner();
         mk.guide.open(3);
     }
@@ -204,13 +206,17 @@ export default class RedBagTask extends cc.Component {
      * 底部提现相关样式
      */
     private initCashOutStyle(redMoney: number = 0) {
+        if(redMoney == 0)
+        {
+            redMoney = gData.gameData.playerProp.redMoney;
+        }
         redMoney = redMoney/100;
         const cash_bar = gData.redBagCash.cash_bar;
         let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
         if (!cash_data) return;
         const newRedMoney = redMoney > cash_data.redMoney ? cash_data.redMoney : redMoney;
         this.lbl_reward_value.string = cash_data.money / 100 + '元';
-        this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney;
+        this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney/100;
         const fillRange = newRedMoney / cash_data.redMoney >= 1 ? 1 : newRedMoney / cash_data.redMoney;
         // this.spr_cash_out.fillRange = fillRange;
         cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();

+ 7 - 1
assets/script/game/module/reward/Reward.ts

@@ -50,6 +50,7 @@ export default class Reward extends cc.Component {
     start() {
         // gData.gameData.playerProp.redMoney = 1500;// 测试数据
         this.initCashOutStyle(gData.gameData.playerProp.redMoney);
+        mk.ui.registerRefreshEvent(this.node, this.initCashOutStyle.bind(this), "refreshCoin");
     }
 
     onEnable() {
@@ -59,6 +60,7 @@ export default class Reward extends cc.Component {
     }
 
     onDisable() {
+        mk.ui.removeRefreshEvent(this.node);
         mk.ad.destoryBanner();
     }
 
@@ -82,13 +84,17 @@ export default class Reward extends cc.Component {
      * 底部提现相关样式
      */
     private initCashOutStyle(redMoney: number = 0) {
+        if(redMoney == 0)
+        {
+            redMoney = gData.gameData.playerProp.redMoney;
+        }
         redMoney = redMoney/100;
         const cash_bar = gData.redBagCash.cash_bar;
         let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
         if (!cash_data) return;
         const newRedMoney = redMoney > cash_data.redMoney ? cash_data.redMoney : redMoney;
         this.lbl_cash.string = cash_data.money / 100 + '元';
-        this.lbl_cash_out.string = newRedMoney + '/' + cash_data.redMoney;
+        this.lbl_cash_out.string = newRedMoney + '/' + cash_data.redMoney/100;
         const fillRange = newRedMoney / cash_data.redMoney >= 1 ? 1 : newRedMoney / cash_data.redMoney;
         // this.spr_cash_out.fillRange = fillRange;
         cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();

+ 8 - 2
assets/script/game/module/speedUpUI/SpeedUpUI.ts

@@ -21,6 +21,8 @@ export default class SpeedUpUI extends cc.Component {
     start() {
         this.initCashOutStyle(gData.gameData.playerProp.redMoney);
         this.lbl_remainTimes.string = `今日剩余次数:${gData.gameData.playerProp.speedUpLeftTimes}`;
+
+        mk.ui.registerRefreshEvent(this.node, this.initCashOutStyle.bind(this), "refreshCoin");
     }
 
     onEnable() {
@@ -28,6 +30,7 @@ export default class SpeedUpUI extends cc.Component {
     }
 
     onDisable() {
+        mk.ui.removeRefreshEvent(this.node);
         mk.ad.destoryBanner();
     }
 
@@ -46,13 +49,17 @@ export default class SpeedUpUI extends cc.Component {
      * 底部提现相关样式
      */
     private initCashOutStyle(redMoney: number = 0) {
+        if(redMoney == 0)
+        {
+            redMoney = gData.gameData.playerProp.redMoney;
+        }
         redMoney = redMoney / 100;
         const cash_bar = gData.redBagCash.cash_bar;
         let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
         if (!cash_data) return;
         const newRedMoney = redMoney > cash_data.redMoney ? cash_data.redMoney : redMoney;
         this.lbl_reward_value.string = cash_data.money / 100 + '元';
-        this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney;
+        this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney/100;
         const fillRange = newRedMoney / cash_data.redMoney >= 1 ? 1 : newRedMoney / cash_data.redMoney;
         // this.spr_cash_out.fillRange = fillRange;
         cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();
@@ -102,7 +109,6 @@ export default class SpeedUpUI extends cc.Component {
         }
     }
 
-
     private clickCloseBtn() {
         mk.audio.playEffect("closeButton");
     }

+ 9 - 1
assets/script/game/module/turntable/Turnablerule.ts

@@ -25,6 +25,7 @@ export default class Turnablerule extends cc.Component {
         mk.ad.showBanner(BannerAdType.banner_click_9);
 
         this.initCashOutStyle(gData.gameData.playerProp.redMoney);
+        mk.ui.registerRefreshEvent(this.node, this.initCashOutStyle.bind(this), "refreshCoin");
     }
 
     update(dt) {
@@ -38,13 +39,17 @@ export default class Turnablerule extends cc.Component {
      * 底部提现相关样式
      */
     private initCashOutStyle(redMoney: number = 0) {
+        if(redMoney == 0)
+        {
+            redMoney = gData.gameData.playerProp.redMoney;
+        }
         redMoney = redMoney/100;
         const cash_bar = gData.redBagCash.cash_bar;
         let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
         if (!cash_data) return;
         const newRedMoney = redMoney > cash_data.redMoney ? cash_data.redMoney : redMoney;
         this.lbl_reward_value.string = cash_data.money / 100 + '元';
-        this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney;
+        this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney/100;
         const fillRange = newRedMoney / cash_data.redMoney >= 1 ? 1 : newRedMoney / cash_data.redMoney;
         // this.spr_cash_out.fillRange = fillRange;
         cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();
@@ -66,6 +71,9 @@ export default class Turnablerule extends cc.Component {
         // mk.ui.openPanel(path);
     }
 
+    onDisable(){
+        mk.ui.removeRefreshEvent(this.node);
+    }
     private onClickClose() {
         mk.audio.playEffect("closeButton");
         mk.ad.destoryBanner();

+ 37 - 0
assets/script/mk/system/UISystem.ts

@@ -18,8 +18,11 @@ export default class UISystem extends cc.Component {
     /** 上一个打开的界面名称 */
     private lastOpenPanelName: string = "";
 
+    private registerCallBack: Map<cc.Node, Map<string, Function>> = new Map<cc.Node, Map<string,Function>>();
+        
     onLoad() {
         mk.ui = this;
+        this.registerCallBack.clear();
     }
 
     start() {
@@ -176,6 +179,40 @@ export default class UISystem extends cc.Component {
         mk.ad.destroyNativeAd()
         mk.ad.destoryBanner()
     }
+
+    registerRefreshEvent(obj: cc.Node, callBack: Function = null, name: string = "default")
+    {
+        let value = this.registerCallBack.get(obj);
+        if(value)
+        {
+            value.set(name, callBack);
+        }else{
+            let m = new Map<string, Function>();
+            m.set(name, callBack);
+            this.registerCallBack.set(obj, m);
+        }
+    }
+
+    invokeRefreshEventByName(name: string)
+    {
+        this.registerCallBack.forEach((value, key)=>{
+            value.forEach((callBack, k)=>{
+                if(k == name)
+                {
+                    callBack && callBack();
+                }          
+            })
+        });
+    }
+
+    removeRefreshEvent(obj:cc.Node)
+    {
+        let value = this.registerCallBack.get(obj);
+        if(value)
+        {
+            this.registerCallBack.delete(obj);
+        }
+    }
 }
 
 /** 界面打开操作 */

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
build/jsb-link/assets/resources/import/c9/c92ee1bb-0e83-4868-97e3-d71b8b58fae0.json


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä