فهرست منبع

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

fengcong 5 سال پیش
والد
کامیت
86dd70b729
52فایلهای تغییر یافته به همراه802 افزوده شده و 225 حذف شده
  1. 685 125
      assets/resources/game/prefab/game.prefab
  2. 0 0
      assets/resources/module/cashNormal.meta
  3. 3 2
      assets/resources/module/cashNormal/cashNormal.prefab
  4. 0 0
      assets/resources/module/cashNormal/cashNormal.prefab.meta
  5. 0 0
      assets/resources/module/cashNormal/prefab.meta
  6. 0 0
      assets/resources/module/cashNormal/prefab/cashNormalItem.prefab
  7. 0 0
      assets/resources/module/cashNormal/prefab/cashNormalItem.prefab.meta
  8. 0 0
      assets/resources/module/cashNormal/texture.meta
  9. 0 0
      assets/resources/module/cashNormal/texture/bg.png
  10. 0 0
      assets/resources/module/cashNormal/texture/bg.png.meta
  11. 0 0
      assets/resources/module/cashNormal/texture/bg1.png
  12. 0 0
      assets/resources/module/cashNormal/texture/bg1.png.meta
  13. 0 0
      assets/resources/module/cashNormal/texture/button.png
  14. 0 0
      assets/resources/module/cashNormal/texture/button.png.meta
  15. 0 0
      assets/resources/module/cashNormal/texture/button1.png
  16. 0 0
      assets/resources/module/cashNormal/texture/button1.png.meta
  17. 0 0
      assets/resources/module/cashNormal/texture/button2.png
  18. 0 0
      assets/resources/module/cashNormal/texture/button2.png.meta
  19. 0 0
      assets/resources/module/cashNormal/texture/close.png
  20. 0 0
      assets/resources/module/cashNormal/texture/close.png.meta
  21. 0 0
      assets/resources/module/cashNormal/texture/icon_hb.png
  22. 0 0
      assets/resources/module/cashNormal/texture/icon_hb.png.meta
  23. 0 0
      assets/resources/module/cashNormal/texture/icon_hb1.png
  24. 0 0
      assets/resources/module/cashNormal/texture/icon_hb1.png.meta
  25. 0 0
      assets/resources/module/cashNormal/texture/icon_hb1_bg.png
  26. 0 0
      assets/resources/module/cashNormal/texture/icon_hb1_bg.png.meta
  27. 0 0
      assets/resources/module/cashNormal/texture/icon_hb1_bg1.png
  28. 0 0
      assets/resources/module/cashNormal/texture/icon_hb1_bg1.png.meta
  29. 0 0
      assets/resources/module/cashNormal/texture/icon_hb_bg.png
  30. 0 0
      assets/resources/module/cashNormal/texture/icon_hb_bg.png.meta
  31. 0 0
      assets/resources/module/cashNormal/texture/title.png
  32. 0 0
      assets/resources/module/cashNormal/texture/title.png.meta
  33. 0 0
      assets/resources/module/cashNormal/texture/title_bg.png
  34. 0 0
      assets/resources/module/cashNormal/texture/title_bg.png.meta
  35. BIN
      assets/resources/module/receiptNotice/到账通知.png
  36. 0 36
      assets/resources/module/receiptNotice/到账通知.png.meta
  37. 4 0
      assets/resources/module/sign/sign.prefab
  38. 15 6
      assets/script/game/component/TableView.ts
  39. 5 5
      assets/script/game/data/GData.ts
  40. 4 1
      assets/script/game/data/GameData.ts
  41. 1 1
      assets/script/game/data/module/CashNormalData.ts
  42. 0 0
      assets/script/game/data/module/CashNormalData.ts.meta
  43. 36 3
      assets/script/game/data/module/SignData.ts
  44. 0 0
      assets/script/game/module/module/cashNormal.meta
  45. 1 1
      assets/script/game/module/module/cashNormal/CashNormal.ts
  46. 0 0
      assets/script/game/module/module/cashNormal/CashNormal.ts.meta
  47. 0 0
      assets/script/game/module/module/cashNormal/CashNormalItem.ts
  48. 0 0
      assets/script/game/module/module/cashNormal/CashNormalItem.ts.meta
  49. 1 1
      assets/script/game/module/module/reward/Reward.ts
  50. 20 2
      assets/script/game/module/module/sign/Sign.ts
  51. 17 34
      assets/script/mk/system/MKSystem.ts
  52. 10 8
      assets/script/mk/system/TipSystem.ts

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 685 - 125
assets/resources/game/prefab/game.prefab


+ 0 - 0
assets/resources/module/redBagCash.meta → assets/resources/module/cashNormal.meta


+ 3 - 2
assets/resources/module/redBagCash/redBagCash.prefab → assets/resources/module/cashNormal/cashNormal.prefab

@@ -13,7 +13,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "redBagCash",
+    "_name": "cashNormal",
     "_objFlags": 0,
     "_parent": null,
     "_children": [
@@ -1905,7 +1905,7 @@
       }
     ],
     "scr_item": [
-      "RedBagItem"
+      "CashNormalItem"
     ],
     "itemInterval": 20,
     "_id": ""
@@ -2145,6 +2145,7 @@
     "node_panel": {
       "__id__": 1
     },
+    "transition_type": 0,
     "onComplete": [],
     "_id": ""
   },

+ 0 - 0
assets/resources/module/redBagCash/redBagCash.prefab.meta → assets/resources/module/cashNormal/cashNormal.prefab.meta


+ 0 - 0
assets/resources/module/redBagCash/prefab.meta → assets/resources/module/cashNormal/prefab.meta


+ 0 - 0
assets/resources/module/redBagCash/prefab/redBagItem.prefab → assets/resources/module/cashNormal/prefab/cashNormalItem.prefab


+ 0 - 0
assets/resources/module/redBagCash/prefab/redBagItem.prefab.meta → assets/resources/module/cashNormal/prefab/cashNormalItem.prefab.meta


+ 0 - 0
assets/resources/module/redBagCash/texture.meta → assets/resources/module/cashNormal/texture.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/bg.png → assets/resources/module/cashNormal/texture/bg.png


+ 0 - 0
assets/resources/module/redBagCash/texture/bg.png.meta → assets/resources/module/cashNormal/texture/bg.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/bg1.png → assets/resources/module/cashNormal/texture/bg1.png


+ 0 - 0
assets/resources/module/redBagCash/texture/bg1.png.meta → assets/resources/module/cashNormal/texture/bg1.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/button.png → assets/resources/module/cashNormal/texture/button.png


+ 0 - 0
assets/resources/module/redBagCash/texture/button.png.meta → assets/resources/module/cashNormal/texture/button.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/button1.png → assets/resources/module/cashNormal/texture/button1.png


+ 0 - 0
assets/resources/module/redBagCash/texture/button1.png.meta → assets/resources/module/cashNormal/texture/button1.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/button2.png → assets/resources/module/cashNormal/texture/button2.png


+ 0 - 0
assets/resources/module/redBagCash/texture/button2.png.meta → assets/resources/module/cashNormal/texture/button2.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/close.png → assets/resources/module/cashNormal/texture/close.png


+ 0 - 0
assets/resources/module/redBagCash/texture/close.png.meta → assets/resources/module/cashNormal/texture/close.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb.png → assets/resources/module/cashNormal/texture/icon_hb.png


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb.png.meta → assets/resources/module/cashNormal/texture/icon_hb.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb1.png → assets/resources/module/cashNormal/texture/icon_hb1.png


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb1.png.meta → assets/resources/module/cashNormal/texture/icon_hb1.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb1_bg.png → assets/resources/module/cashNormal/texture/icon_hb1_bg.png


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb1_bg.png.meta → assets/resources/module/cashNormal/texture/icon_hb1_bg.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb1_bg1.png → assets/resources/module/cashNormal/texture/icon_hb1_bg1.png


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb1_bg1.png.meta → assets/resources/module/cashNormal/texture/icon_hb1_bg1.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb_bg.png → assets/resources/module/cashNormal/texture/icon_hb_bg.png


+ 0 - 0
assets/resources/module/redBagCash/texture/icon_hb_bg.png.meta → assets/resources/module/cashNormal/texture/icon_hb_bg.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/title.png → assets/resources/module/cashNormal/texture/title.png


+ 0 - 0
assets/resources/module/redBagCash/texture/title.png.meta → assets/resources/module/cashNormal/texture/title.png.meta


+ 0 - 0
assets/resources/module/redBagCash/texture/title_bg.png → assets/resources/module/cashNormal/texture/title_bg.png


+ 0 - 0
assets/resources/module/redBagCash/texture/title_bg.png.meta → assets/resources/module/cashNormal/texture/title_bg.png.meta


BIN
assets/resources/module/receiptNotice/到账通知.png


+ 0 - 36
assets/resources/module/receiptNotice/到账通知.png.meta

@@ -1,36 +0,0 @@
-{
-  "ver": "2.3.5",
-  "uuid": "5d12289f-517c-4bc7-9e58-3174af57ee24",
-  "type": "sprite",
-  "wrapMode": "clamp",
-  "filterMode": "bilinear",
-  "premultiplyAlpha": false,
-  "genMipmaps": false,
-  "packable": true,
-  "width": 750,
-  "height": 1334,
-  "platformSettings": {},
-  "subMetas": {
-    "到账通知": {
-      "ver": "1.0.4",
-      "uuid": "7fe555ed-39aa-435c-a1ae-c47748d0ff9e",
-      "rawTextureUuid": "5d12289f-517c-4bc7-9e58-3174af57ee24",
-      "trimType": "auto",
-      "trimThreshold": 1,
-      "rotated": false,
-      "offsetX": 0,
-      "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 750,
-      "height": 1334,
-      "rawWidth": 750,
-      "rawHeight": 1334,
-      "borderTop": 0,
-      "borderBottom": 0,
-      "borderLeft": 0,
-      "borderRight": 0,
-      "subMetas": {}
-    }
-  }
-}

+ 4 - 0
assets/resources/module/sign/sign.prefab

@@ -1602,6 +1602,7 @@
     "node_panel": {
       "__id__": 1
     },
+    "transition_type": 0,
     "onComplete": [],
     "_id": ""
   },
@@ -1654,6 +1655,9 @@
     "scroll_view": {
       "__id__": 12
     },
+    "node_content": {
+      "__id__": 8
+    },
     "anim_btn": {
       "__id__": 33
     },

+ 15 - 6
assets/script/game/component/TableView.ts

@@ -27,7 +27,7 @@ export default class TableView extends cc.Component {
     /** item预制体组 */
     private item: Array<any> = null;
     /** 滑动列表的内容节点 */
-    private content: any = null;
+    private content: cc.Node = null;
     /** 列表高 */
     private layerHeight: any = null;
     /** ? */
@@ -94,7 +94,7 @@ export default class TableView extends cc.Component {
         // }
         // cc.log(this.testTime(0));// 消耗计时
         this.initItem();
-        this.getItemPos(0);
+        this.initItemPos(0);
         this.scrollView.node.on('scrolling', this.callback, this);
         // cc.log('tableView结束:' + this.testTime());
     }
@@ -107,7 +107,7 @@ export default class TableView extends cc.Component {
 
     }
 
-    private getItemPos(index: number) {
+    private initItemPos(index: number) {
         let item_data_count = this.itemData.length;
         for (let i = index; i < item_data_count; i++) {
             let obj: any = {}
@@ -295,7 +295,7 @@ export default class TableView extends cc.Component {
     }
 
     /** 滚动到底部 */
-    private itemMoveDown(num: number) {
+    public itemMoveDown(num: number) {
         if (num < 0 || this.firstItemIndex - 1 > num || num + 1 > this.itemData.length) {
             return;
         }
@@ -348,6 +348,15 @@ export default class TableView extends cc.Component {
     }
 
     /**
+     * 内容滚动到指定下标位置
+     * @param index 条目index
+     */
+    public contentMoveByIndex(index: number) {
+        let pos_y = this.itemPosMap.get(index).startPos;
+        this.scrollView.scrollToOffset(new cc.Vec2(this.content.x, pos_y), 0.5);
+    }
+
+    /**
      * 得到相关位置的排序index
      * 方法待验证,可能有问题
      * @param pos 坐标
@@ -368,7 +377,7 @@ export default class TableView extends cc.Component {
      */
     public addItem(obj: any) {
         this.itemData.push(obj);
-        this.getItemPos(this.itemData.length - 1);
+        this.initItemPos(this.itemData.length - 1);
         let endPos = this.itemPosMap.get(this.itemData.length - 1).endPos;
         if (endPos - this.layerHeight > 0) {
             let startPos = endPos - this.layerHeight;
@@ -416,7 +425,7 @@ export default class TableView extends cc.Component {
         this.itemData.splice(i, 1);
         const item_data_count = this.itemData.length;
         if (item_data_count <= 0) return;
-        this.getItemPos(item_data_count - 1);
+        this.initItemPos(item_data_count - 1);
 
         //改变this.itemArr的内容
         for (let j = 0; j < this.itemArr.length; j++) {

+ 5 - 5
assets/script/game/data/GData.ts

@@ -16,7 +16,7 @@ import { AdData } from "./AdData";
 import { RewardData } from "./module/RewardData";
 import MoreGameData from "./MoreGameData";
 import { Data } from "../../mk/data/Data";
-import { RedBagCashData } from "./module/RedBagCashData";
+import { CashNormalData } from "./module/CashNormalData";
 import { ReceiptNoticeData } from "./module/ReceiptNoticeData";
 
 /**
@@ -55,7 +55,7 @@ class GData {
     /** 到账通知 */
     public receiptNotice: ReceiptNoticeData;
     /** 红包提现(常规提现) */
-    public redBagCash: RedBagCashData;
+    public cashNormal: CashNormalData;
     /** 更多游戏 */
     public moreGame: MoreGameData;
     /** 模块数据 */
@@ -78,7 +78,7 @@ class GData {
         this.luckybag = new LuckyBagData();
         this.sign = new SignData();
         this.receiptNotice = new ReceiptNoticeData();
-        this.redBagCash = new RedBagCashData();
+        this.cashNormal = new CashNormalData();
         this.moreGame = new MoreGameData();
 
         this.moduleData = new Map<number, Data>();
@@ -88,7 +88,7 @@ class GData {
         this.moduleData.set(Fun.pigbank, this.pigbank);
         this.moduleData.set(Fun.luckybag, this.luckybag);
         this.moduleData.set(Fun.sign, this.sign);
-        this.moduleData.set(Fun.redBagCash, this.redBagCash);
+        this.moduleData.set(Fun.cashNormal, this.cashNormal);
     }
 }
 
@@ -102,7 +102,7 @@ export enum Fun {
     pigbank = 4,    //存钱罐
     luckybag = 5,   //福袋
     sign = 6,       //签到
-    redBagCash = 7, //常规提现
+    cashNormal = 7, //常规提现
 }
 
 declare global {

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

@@ -52,7 +52,8 @@ export class GameData {
         gData.moduleData.forEach(element => {
             element.init();
         });
-
+        // 提现记录数据
+        gData.cashNormal.getRecord()
         this.dataFinish = true;
     }
 
@@ -191,6 +192,8 @@ export enum AUDIO_TYPE {
 type PlayerInfoType = {
     /** 自定义不需要校验的数据 */
     gameUserData: object,
+    /** 今日是否有签到 */
+    isSignInToday: boolean,
     /** 存钱罐存款 */
     piggyBank: number,
     /** 存钱罐能否提现 */

+ 1 - 1
assets/script/game/data/module/RedBagCashData.ts → assets/script/game/data/module/CashNormalData.ts

@@ -3,7 +3,7 @@ import { Data } from "../../../mk/data/Data";
  * 红包提现数据
  * @author 薛鸿潇
  */
-export class RedBagCashData extends Data {
+export class CashNormalData extends Data {
     
 
     public async getRecord(){

+ 0 - 0
assets/script/game/data/module/RedBagCashData.ts.meta → assets/script/game/data/module/CashNormalData.ts.meta


+ 36 - 3
assets/script/game/data/module/SignData.ts

@@ -18,15 +18,21 @@ export class SignData extends Data {
                 }
             });
             this.c_sign = gData.gameData.configs.SignIn;
+            this.init_list = true;
         }
         // 服务端数据不对
         // this.sign_last_bar = gData.gameData.gameData.signInDay;
+        // this.sign_can = gData.gameData.gameData.isSignInToday;
+
+        // 客户端测试数据
         this.sign_last_bar = gData.gameData.getProp(GameProp.sign_last_bar);
         // this.sign_can = gData.gameData.getProp(GameProp.sign_can);
     }
 
     /** 标志位:是否需要刷新数据 */
     public init_data: boolean = false;
+    /** 标志位:是否初始化配置列表 */
+    public init_list: boolean = false;
 
     /** 配置数据 签到 */
     private _c_sign: Array<CSignType> = [];
@@ -38,8 +44,8 @@ export class SignData extends Data {
         return this._c_sign;
     }
 
-    // 服务端数据 上次签到天数
     private _sign_last_bar = 0;
+    /** 上次签到天数 */
     set sign_last_bar(value: number) {
         this._sign_last_bar = value;
         this.init_data = true;
@@ -48,8 +54,8 @@ export class SignData extends Data {
         return this._sign_last_bar;
     }
 
-    // 服务端数据 能够签到
     private _sign_can = 1;
+    /** 能够签到 */
     set sign_can(value: number) {
         this._sign_can = value;
         this.init_data = true;
@@ -59,7 +65,7 @@ export class SignData extends Data {
     }
 
     /** 签到列表数据 */
-    public list_data = [];
+    public list_data: Array<Array<CSignType>> = [];
     /** 初始化列表数据 */
     public initListData() {
         // if (!this.c_sign.length) this.c_sign = this.getSignConfig();
@@ -154,6 +160,33 @@ export class SignData extends Data {
         // 获得奖励
     }
 
+    /**
+     * 获取数据列表中第一个可签到条目的index
+     * @returns index
+     */
+    public getItemIndexByCanSign(): number {
+        let index = 0;
+        const l_count = this.list_data.length;
+        for (let i = 0; i < l_count; i++) {
+            const i_count = this.list_data[i].length;
+            for (let j = 0; j < i_count; j++) {
+                let state = this.getStateByDay(this.list_data[i][j].loginDay);
+                if (this.sign_can) {
+                    if (state === RewardState.unlock) {
+                        index = i;
+                        return index
+                    }
+                } else {
+                    if (state === RewardState.lock) {
+                        index = i;
+                        return index
+                    }
+                }
+            }
+        }
+        return index;
+    }
+
 }
 
 export type CSignType = {

+ 0 - 0
assets/script/game/module/module/redBagCash.meta → assets/script/game/module/module/cashNormal.meta


+ 1 - 1
assets/script/game/module/module/redBagCash/RedBagCash.ts → assets/script/game/module/module/cashNormal/CashNormal.ts

@@ -17,7 +17,7 @@ export default class RedBagCash extends cc.Component {
     start() {
         this.initScrollView();
         // 请求记录
-        // gData.redBagCash.getRecord()
+        // gData.cashNormal.getRecord()
     }
 
     // update (dt) {}

+ 0 - 0
assets/script/game/module/module/redBagCash/RedBagCash.ts.meta → assets/script/game/module/module/cashNormal/CashNormal.ts.meta


+ 0 - 0
assets/script/game/module/module/redBagCash/RedBagItem.ts → assets/script/game/module/module/cashNormal/CashNormalItem.ts


+ 0 - 0
assets/script/game/module/module/redBagCash/RedBagItem.ts.meta → assets/script/game/module/module/cashNormal/CashNormalItem.ts.meta


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

@@ -107,7 +107,7 @@ export default class Reward extends cc.Component {
      * 看广告回调:开奖
      */
     private watchVideoCall() {
-        if (!gData.reward.data || gData.reward.data.length) return;
+        if (!gData.reward.data || !gData.reward.data.length) return;
         // 数据排序:多条奖励,只展示红包,把红包放在首位
         const r_count = gData.reward.data.length;
         if (r_count >= 2) {

+ 20 - 2
assets/script/game/module/module/sign/Sign.ts

@@ -1,3 +1,4 @@
+import TableView from "../../../component/TableView";
 import { AdFun } from "../../../data/AdData";
 import { GameProp, RewardState } from "../../../data/GameData";
 
@@ -15,9 +16,13 @@ export default class Sign extends cc.Component {
 
     @property({ type: cc.ScrollView, displayName: '滚动视图' })
     private scroll_view: cc.ScrollView = null!;
+    @property({ type: cc.Node, displayName: '滚动内容容器' })
+    private node_content: cc.Node = null!;
+
     @property({ type: cc.Animation, displayName: '按钮_动画' })
     private anim_btn: cc.Animation = null!;
 
+    private tableview: TableView = null;
     onLoad() {
 
     }
@@ -26,7 +31,6 @@ export default class Sign extends cc.Component {
         // gData.sign.sign_can = gData.gameData.getProp(GameProp.sign_can);
         gData.sign.initListData();
         gData.sign.init_data = true;
-        cc.log(gData.sign.sign_last_bar)
     }
 
     /**
@@ -35,16 +39,24 @@ export default class Sign extends cc.Component {
     private initScollView() {
         let list_data = gData.sign.list_data;
         this.scroll_view.node.emit('srollview-init', list_data)
+        this.tableview = this.scroll_view.node.getComponent('TableView')
+
+        let index = gData.sign.getItemIndexByCanSign();
+        this.tableview.contentMoveByIndex(index)
     }
 
 
     update(dt) {
         if (gData.sign.init_data) {
             gData.sign.init_data = false;
-            this.initScollView();
             this.initBtnStyle();
             return;
         }
+        if (gData.sign.init_list) {
+            gData.sign.init_list = false;
+            this.initScollView();
+            return;
+        }
         if (gData.sign.adData) {
             // 展示奖励
             this.getReward();
@@ -67,7 +79,13 @@ export default class Sign extends cc.Component {
      * 拿奖励
      */
     private getReward() {
+        let index_old = gData.sign.getItemIndexByCanSign();
+        // 完成展示
         gData.sign.signComplete();
+
+        // 指定条目数据刷新
+        this.tableview.resetItemData(index_old, gData.sign.list_data[index_old]);
+
         // 打开奖励界面
         // to do
     }

+ 17 - 34
assets/script/mk/system/MKSystem.ts

@@ -31,93 +31,76 @@ class MKSystem {
     /** 工具 */
     private _time: TimeUtil;
     public get time(): TimeUtil {
-        if (!this._time) this._time = new TimeUtil();
-        return this._time;
+        return this._time || (this._time = new TimeUtil());
     }
     private _file: FileUtil;
     public get file(): FileUtil {
-        if(!this._file) this._file = new FileUtil();
-        return this._file;
+        return this._file || (this._file = new FileUtil());
     }
     private _encrypt: EncryptUtil;
     public get encrypt(): EncryptUtil {
-        if(!this._encrypt) this._encrypt = new EncryptUtil();
-        return this._encrypt;
+        return this._encrypt || (this._encrypt = new EncryptUtil());
     }
     private _console: LogUtil;
     public get console(): LogUtil {
-        if(!this._console) this._console = new LogUtil();
-        return this._console;
+        return this._console || (this._console = new LogUtil());
     }
     private _game: GameUtil;
     public get game(): GameUtil {
-        if(!this._game) this._game = new GameUtil();
-        return this._game;
+        return this._game || (this._game = new GameUtil());
     }
     private _loader: LoadResUtil;
     public get loader(): LoadResUtil {
-        if(!this._loader) this._loader = new LoadResUtil();
-        return this._loader;
+        return this._loader || (this._loader = new LoadResUtil());
     }
     private _storage: StorageUtil;
     public get storage(): StorageUtil {
-        if(!this._storage) this._storage = new StorageUtil();
-        return this._storage;
+        return this._storage || (this._storage = new StorageUtil());
     }
     private _math: MathUtil;
     public get math(): MathUtil {
-        if(!this._math) this._math = new MathUtil();
-        return this._math;
+        return this._math || (this._math = new MathUtil());
     }
 
     /** SDK */
     private _bugly: BuglySDK;
     public get bugly(): BuglySDK {
-        if(!this._bugly) this._bugly = new BuglySDK();
-        return this._bugly;
+        return this._bugly || (this._bugly = new BuglySDK());
     }
 
 
     /** 系统管理 */
     private _data: DataSystem;
     public get data(): DataSystem {
-        if(!this._data) this._data = new DataSystem();
-        return this._data;
+        return this._data || (this._data = new DataSystem());
     }
     private _ad: AdSystem;
     public get ad(): AdSystem {
-        if(!this._ad) this._ad = new AdSystem(ATSDKMgr.getInstance());
-        return this._ad;
+        return this._ad || (this._ad = new AdSystem(ATSDKMgr.getInstance()));
     }
     private _jsb: JsbSystem;
     public get jsb(): JsbSystem {
-        if(!this._jsb) this._jsb = new JsbSystem();
-        return this._jsb;
+        return this._jsb || (this._jsb = new JsbSystem());
     }
     private _http: HttpSystem;
     public get http(): HttpSystem {
-        if(!this._http) this._http = new HttpSystem();
-        return this._http;
+        return this._http || (this._http = new HttpSystem());
     }
     private _audio: AudioSystem;
     public get audio(): AudioSystem {
-        if(!this._audio) this._audio = new AudioSystem();
-        return this._audio;
+        return this._audio || (this._audio = new AudioSystem());
     }
     private _timer: TimerSystem;
     public get timer(): TimerSystem {
-        if(!this._timer) this._timer = new TimerSystem();
-        return this._timer;
+        return this._timer || (this._timer = new TimerSystem());
     }
     private _event: EventSystem;
     public get event(): EventSystem {
-        if(!this._event) this._event = new EventSystem();
-        return this._event;
+        return this._event || (this._event = new EventSystem());
     }
     private _pool: PoolSystem;
     public get pool(): PoolSystem {
-        if(!this._pool) this._pool = new PoolSystem();
-        return this._pool;
+        return this._pool || (this._pool = new PoolSystem());
     }
 
     /** 挂载在MainScene的界面上,不需要new */

+ 10 - 8
assets/script/mk/system/TipSystem.ts

@@ -18,10 +18,10 @@ export default class TipSystem extends cc.Component {
     tar_y: number = 100;
     @property({ type: cc.Integer, displayName: "背景透明度" })
     bg_opacity: number = 40;
-    @property({ type: cc.Color, displayName: "背景颜色" })
-    bg_color: cc.Color = new cc.Color(200, 200, 200);
-    @property({ type: cc.Color, displayName: "文本颜色" })
-    tip_color: cc.Color = new cc.Color(255, 255, 255);
+    @property({ displayName: "背景颜色" })
+    bg_color = new cc.Color(200, 200, 200);
+    @property({ displayName: "文本颜色" })
+    tip_color = new cc.Color(255, 255, 255);
     @property({ type: cc.Integer, displayName: "文本字体" })
     tip_size: number = 40;
 
@@ -38,10 +38,12 @@ export default class TipSystem extends cc.Component {
 
     public async pop(str: string) {
         let node = await mk.pool.getPrefab("game/prefab/tips");
-        let bg = node.getChildByName("bg");
-        let lbl = node.getChildByName("lbl");
-        bg.getComponent(cc.Sprite)
-        console.log(node);
+        let node_bg = node.getChildByName("bg");
+        let node_lbl = node.getChildByName("lbl");
+        let bg = node_bg.getComponent(cc.Sprite);
+        let lbl = node_lbl.getComponent(cc.Label);
+        node_bg.opacity = this.bg_opacity;
+        // node_bg.color = 
     }
 
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است