Explorar o código

红点功能添加

薛鸿潇 %!s(int64=5) %!d(string=hai) anos
pai
achega
c3fd5b1495

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 435 - 105
assets/resources/game/prefab/game.prefab


BIN=BIN
assets/resources/game/texture/main/default_radio_button_off.png


+ 36 - 0
assets/resources/game/texture/main/default_radio_button_off.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "e965e12a-5549-461a-b545-ae931736dd65",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 32,
+  "height": 32,
+  "platformSettings": {},
+  "subMetas": {
+    "default_radio_button_off": {
+      "ver": "1.0.4",
+      "uuid": "c66d31a0-72c4-4f57-a80a-fdbb65f657cc",
+      "rawTextureUuid": "e965e12a-5549-461a-b545-ae931736dd65",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 3,
+      "trimY": 3,
+      "width": 26,
+      "height": 26,
+      "rawWidth": 32,
+      "rawHeight": 32,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 0 - 12
assets/resources/module/hotUpdate/perfab.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "e45f4d0f-7aa3-4f6e-a64f-6b9bcde71855",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

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

@@ -29,6 +29,9 @@ export class GameData {
     /** 标志位:刷新主界面头像 */
     public init_head: boolean = false;
 
+    /** 标志位:刷新主界面红点 */
+    public init_red_point: boolean = true;
+
     public props: Map<number, number> = new Map<number, number>();
 
     public pools = [
@@ -251,6 +254,7 @@ class PlayerProp {
     set isSignInToday(value: number) {
         this._isSignInToday = value;
         gData.sign.init_data = true;
+        gData.gameData.init_red_point = true;
     }
     get isSignInToday(): number {
         return this._isSignInToday;
@@ -278,6 +282,7 @@ class PlayerProp {
         if (this._isWithdrawable != value) {
             this._isWithdrawable = value;
             gData.pigbank.init_data = true;
+            gData.gameData.init_red_point = true;
         }
     }
     get isWithdrawable(): number {

+ 0 - 6
assets/script/game/data/RedPointData.ts

@@ -1,6 +0,0 @@
-/**
- * 红点数据
- * @author 薛鸿潇
- */
-export default class RedPointData extends cc.Component {
-}

+ 0 - 9
assets/script/game/data/RedPointData.ts.meta

@@ -1,9 +0,0 @@
-{
-  "ver": "1.0.8",
-  "uuid": "996c3973-5e93-406e-b879-eb2875d7e2f2",
-  "isPlugin": false,
-  "loadPluginInWeb": true,
-  "loadPluginInNative": true,
-  "loadPluginInEditor": false,
-  "subMetas": {}
-}

+ 8 - 0
assets/script/game/data/module/PigBankData.ts

@@ -49,4 +49,12 @@ export class PigBankData extends Data {
         gData.cashNormal.getRecord();// 请求新的提现记录
 
     }
+
+    /**
+     * 红点功能
+     */
+    public redPoint(): boolean {
+        let bool = !!gData.gameData.gameData.isWithdrawable;
+        return bool;
+    }
 }

+ 8 - 0
assets/script/game/data/module/SignData.ts

@@ -188,6 +188,14 @@ export class SignData extends Data {
         return index;
     }
 
+    /**
+     * 红点功能
+     */
+    public redPoint(): boolean {
+        let bool = !gData.gameData.gameData.isSignInToday && this.haveSignDay();
+        return bool;
+    }
+
 }
 
 export type CSignType = {

+ 29 - 1
assets/script/game/game/Game.ts

@@ -5,6 +5,20 @@ import FunBtns from "./FunBtns";
 
 const { ccclass, property } = cc._decorator;
 
+@ccclass("RedPoinNode")
+export class RedPoinNode {
+    @property({ type: cc.Node, displayName: "签到" })
+    node_sign: cc.Node = null;
+    @property({ type: cc.Node, displayName: "存钱罐" })
+    node_pigbank: cc.Node = null;
+    @property({ type: cc.Node, displayName: "福袋" })
+    node_blessingBag: cc.Node = null;
+    @property({ type: cc.Node, displayName: "转盘" })
+    node_turnable: cc.Node = null;
+    @property({ type: cc.Node, displayName: "福利礼包" })
+    node_redeem: cc.Node = null;
+}
+
 @ccclass
 export default class Game extends cc.Component {
 
@@ -38,6 +52,8 @@ export default class Game extends cc.Component {
 
     @property({ type: cc.Node, displayName: "顶部ui组" })
     node_top_ui: cc.Node = null;
+    @property({ type: RedPoinNode, displayName: "红点组" })
+    nodeRedPoint: RedPoinNode = null;
 
 
     onLoad() {
@@ -88,6 +104,10 @@ export default class Game extends cc.Component {
         if (gData.gameData.init_head) {
             this.initHead();
         }
+
+        if (gData.gameData.init_red_point) {
+            this.initRedPoint();
+        }
     }
     lateUpdate() {
         gData.gameData.init_head = false;
@@ -143,6 +163,14 @@ export default class Game extends cc.Component {
     }
 
     /**
+     * 初始化红点
+     */
+    private initRedPoint() {
+        this.nodeRedPoint.node_sign.active = gData.sign.redPoint();
+        this.nodeRedPoint.node_pigbank.active = gData.pigbank.redPoint();
+        gData.gameData.init_red_point = false;
+    }
+    /**
      * 自动打开面板
      * - isAutoOpenPanel 1自动开 2不自动开 其他不处理
      */
@@ -166,7 +194,7 @@ export default class Game extends cc.Component {
     }
 
     /** */
-    public onClickStart(a,b) {
+    public onClickStart(a, b) {
         this.node_gameplay.active = true;
     }
 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio