薛鸿潇 5 лет назад
Родитель
Сommit
12f85098d0

+ 144 - 31
assets/resources/game/prefab/game.prefab

@@ -30,13 +30,13 @@
         "__id__": 16
         "__id__": 16
       },
       },
       {
       {
-        "__id__": 179
+        "__id__": 182
       },
       },
       {
       {
-        "__id__": 182
+        "__id__": 185
       },
       },
       {
       {
-        "__id__": 191
+        "__id__": 194
       },
       },
       {
       {
         "__id__": 125
         "__id__": 125
@@ -45,14 +45,14 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 193
+        "__id__": 196
       },
       },
       {
       {
-        "__id__": 195
+        "__id__": 198
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 196
+      "__id__": 199
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -527,7 +527,7 @@
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 178
+      "__id__": 181
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -4068,16 +4068,19 @@
       },
       },
       {
       {
         "__id__": 173
         "__id__": 173
+      },
+      {
+        "__id__": 176
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 176
+        "__id__": 179
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 177
+      "__id__": 180
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -5871,6 +5874,113 @@
     "sync": false
     "sync": false
   },
   },
   {
   {
+    "__type__": "cc.Node",
+    "_name": "node_red_point",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 123
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 177
+      }
+    ],
+    "_prefab": {
+      "__id__": 178
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 26,
+      "height": 26
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        120,
+        25.038,
+        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__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 176
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "c66d31a0-72c4-4f57-a80a-fdbb65f657cc"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
+    },
+    "fileId": "f6Flm99DxJ3LBNuw2YsF1P",
+    "sync": false
+  },
+  {
     "__type__": "b8d2cnq+GZLFK30xbLDqr/m",
     "__type__": "b8d2cnq+GZLFK30xbLDqr/m",
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
@@ -5918,11 +6028,11 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 180
+        "__id__": 183
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 181
+      "__id__": 184
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -5976,7 +6086,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 179
+      "__id__": 182
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -6033,20 +6143,20 @@
     },
     },
     "_children": [
     "_children": [
       {
       {
-        "__id__": 183
+        "__id__": 186
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 187
+        "__id__": 190
       },
       },
       {
       {
-        "__id__": 189
+        "__id__": 192
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 190
+      "__id__": 193
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -6100,20 +6210,20 @@
     "_name": "Background",
     "_name": "Background",
     "_objFlags": 512,
     "_objFlags": 512,
     "_parent": {
     "_parent": {
-      "__id__": 182
+      "__id__": 185
     },
     },
     "_children": [],
     "_children": [],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 184
+        "__id__": 187
       },
       },
       {
       {
-        "__id__": 185
+        "__id__": 188
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 186
+      "__id__": 189
     },
     },
     "_opacity": 255,
     "_opacity": 255,
     "_color": {
     "_color": {
@@ -6167,7 +6277,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 183
+      "__id__": 186
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_materials": [
     "_materials": [
@@ -6199,7 +6309,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 183
+      "__id__": 186
     },
     },
     "_enabled": true,
     "_enabled": true,
     "alignMode": 0,
     "alignMode": 0,
@@ -6237,7 +6347,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 182
+      "__id__": 185
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_normalMaterial": null,
     "_normalMaterial": null,
@@ -6246,7 +6356,7 @@
     "zoomScale": 1.2,
     "zoomScale": 1.2,
     "clickEvents": [
     "clickEvents": [
       {
       {
-        "__id__": 188
+        "__id__": 191
       }
       }
     ],
     ],
     "_N$interactable": true,
     "_N$interactable": true,
@@ -6314,7 +6424,7 @@
       "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
       "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
     },
     },
     "_N$target": {
     "_N$target": {
-      "__id__": 183
+      "__id__": 186
     },
     },
     "_id": ""
     "_id": ""
   },
   },
@@ -6333,7 +6443,7 @@
     "_name": "",
     "_name": "",
     "_objFlags": 0,
     "_objFlags": 0,
     "node": {
     "node": {
-      "__id__": 182
+      "__id__": 185
     },
     },
     "_enabled": true,
     "_enabled": true,
     "_defaultClip": {
     "_defaultClip": {
@@ -6365,7 +6475,7 @@
       "__id__": 1
       "__id__": 1
     },
     },
     "_prefab": {
     "_prefab": {
-      "__id__": 192
+      "__id__": 195
     },
     },
     "_name": "游戏核心",
     "_name": "游戏核心",
     "_active": false,
     "_active": false,
@@ -6396,7 +6506,7 @@
   {
   {
     "__type__": "cc.PrefabInfo",
     "__type__": "cc.PrefabInfo",
     "root": {
     "root": {
-      "__id__": 191
+      "__id__": 194
     },
     },
     "asset": {
     "asset": {
       "__uuid__": "4c49ec9e-c64a-4921-84eb-9bdd737656e5"
       "__uuid__": "4c49ec9e-c64a-4921-84eb-9bdd737656e5"
@@ -6413,7 +6523,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "node_gameplay": {
     "node_gameplay": {
-      "__id__": 191
+      "__id__": 194
     },
     },
     "node_btn": {
     "node_btn": {
       "__id__": 16
       "__id__": 16
@@ -6443,7 +6553,7 @@
       "__id__": 12
       "__id__": 12
     },
     },
     "btn_start": {
     "btn_start": {
-      "__id__": 187
+      "__id__": 190
     },
     },
     "icon_hb": {
     "icon_hb": {
       "__id__": 170
       "__id__": 170
@@ -6455,7 +6565,7 @@
       "__id__": 124
       "__id__": 124
     },
     },
     "nodeRedPoint": {
     "nodeRedPoint": {
-      "__id__": 194
+      "__id__": 197
     },
     },
     "_id": ""
     "_id": ""
   },
   },
@@ -6467,6 +6577,9 @@
     "node_pigbank": {
     "node_pigbank": {
       "__id__": 86
       "__id__": 86
     },
     },
+    "node_redbagCash": {
+      "__id__": 176
+    },
     "node_blessingBag": {
     "node_blessingBag": {
       "__id__": 102
       "__id__": 102
     },
     },

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

@@ -267,6 +267,7 @@ class PlayerProp {
         this._piggyBank = value;
         this._piggyBank = value;
         gData.gameData.init_coin = true;
         gData.gameData.init_coin = true;
         gData.pigbank.init_data = true;
         gData.pigbank.init_data = true;
+        gData.gameData.init_red_point = true;
     }
     }
     get piggyBank(): number {
     get piggyBank(): number {
         return this._piggyBank;
         return this._piggyBank;
@@ -306,6 +307,7 @@ class PlayerProp {
     set redMoney(value: number) {
     set redMoney(value: number) {
         this._redMoney = value;
         this._redMoney = value;
         gData.gameData.init_coin = true;
         gData.gameData.init_coin = true;
+        gData.gameData.init_red_point = true;
     }
     }
     get redMoney(): number {
     get redMoney(): number {
         return this._redMoney;
         return this._redMoney;

+ 2 - 1
assets/script/game/data/module/PigBankData.ts

@@ -16,6 +16,7 @@ export class PigBankData extends Data {
      * 数据初始化
      * 数据初始化
      */
      */
     public init() {
     public init() {
+        this.cash_min_limit = gData.gameData.configs.ServerConfig.PiggyBankCashMoney;
     }
     }
 
 
     /** 标志位:是否需要刷新数据 */
     /** 标志位:是否需要刷新数据 */
@@ -54,7 +55,7 @@ export class PigBankData extends Data {
      * 红点功能
      * 红点功能
      */
      */
     public redPoint(): boolean {
     public redPoint(): boolean {
-        let bool = !!gData.gameData.gameData.isWithdrawable;
+        let bool = !!gData.gameData.gameData.isWithdrawable && gData.gameData.gameData.piggyBank >= this.cash_min_limit;
         return bool;
         return bool;
     }
     }
 }
 }

+ 13 - 0
assets/script/game/data/module/RedBagCashData.ts

@@ -136,6 +136,19 @@ export class RedBagCashData extends Data {
         }
         }
         this.init_list = true;
         this.init_list = true;
     }
     }
+
+    /**
+     * 红点功能
+     */
+    public redPoint(): boolean {
+        const redbag_count = gData.gameData.gameData.redMoney;
+        const d_count = this.c_data.length;
+        for (let i = 0; i < d_count; i++) {
+            if (this.c_data[i].index <= gData.redBagCash.cash_bar) continue;// 已提现
+            if (redbag_count >= this.c_data[i].type_value) return true;// 可提现
+        }
+        return false;
+    }
 }
 }
 /** 配置表数据内容 */
 /** 配置表数据内容 */
 export type CDataType = {
 export type CDataType = {

+ 3 - 0
assets/script/game/game/Game.ts

@@ -11,6 +11,8 @@ export class RedPoinNode {
     node_sign: cc.Node = null;
     node_sign: cc.Node = null;
     @property({ type: cc.Node, displayName: "存钱罐" })
     @property({ type: cc.Node, displayName: "存钱罐" })
     node_pigbank: cc.Node = null;
     node_pigbank: cc.Node = null;
+    @property({ type: cc.Node, displayName: "红包提现" })
+    node_redbagCash: cc.Node = null;
     @property({ type: cc.Node, displayName: "福袋" })
     @property({ type: cc.Node, displayName: "福袋" })
     node_blessingBag: cc.Node = null;
     node_blessingBag: cc.Node = null;
     @property({ type: cc.Node, displayName: "转盘" })
     @property({ type: cc.Node, displayName: "转盘" })
@@ -168,6 +170,7 @@ export default class Game extends cc.Component {
     private initRedPoint() {
     private initRedPoint() {
         this.nodeRedPoint.node_sign.active = gData.sign.redPoint();
         this.nodeRedPoint.node_sign.active = gData.sign.redPoint();
         this.nodeRedPoint.node_pigbank.active = gData.pigbank.redPoint();
         this.nodeRedPoint.node_pigbank.active = gData.pigbank.redPoint();
+        this.nodeRedPoint.node_redbagCash.active = gData.redBagCash.redPoint();
         this.nodeRedPoint.node_turnable.active = gData.turnable.redPoint();
         this.nodeRedPoint.node_turnable.active = gData.turnable.redPoint();
         this.nodeRedPoint.node_blessingBag.active = gData.blessingBag.redPoint();
         this.nodeRedPoint.node_blessingBag.active = gData.blessingBag.redPoint();
         this.nodeRedPoint.node_redeem.active = gData.redeem.redPoint();
         this.nodeRedPoint.node_redeem.active = gData.redeem.redPoint();