Przeglądaj źródła

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

kaka 5 lat temu
rodzic
commit
32ef505010

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

@@ -1,5 +1,4 @@
 import JsbSystem from "../../mk/system/JsbSystem";
-import NumberAnim from "../component/NumberAnim";
 import { GameProp } from "../data/GameData";
 import FunBtns from "./FunBtns";
 
@@ -147,13 +146,13 @@ export default class Game extends cc.Component {
     }
 
     private changeInfo() {
-        this.lbl_redMoney.node.getComponent(NumberAnim).setValue(gData.gameData.gameData.redMoney);
+        this.lbl_redMoney.node.getComponent(mk.component.NumberAnim).setValue(gData.gameData.gameData.redMoney);
         // this.lbl_rmb.node.getComponent('NumberAnim').setValue(gData.gameData.gameData.piggyBank);
 
         const new_count = gData.gameData.gameData.piggyBank / 100;
         if (parseInt(this.lbl_rmb.string) == 0 && new_count != 0 || parseInt(this.lbl_rmb.string) != 0 && new_count == 0) {
             if (this.lbl_rmb.string != new_count.toFixed(2)) {
-                this.lbl_rmb.node.getComponent(NumberAnim).setValue(parseFloat(new_count.toFixed(2)), 2);
+                this.lbl_rmb.node.getComponent(mk.component.NumberAnim).setValue(parseFloat(new_count.toFixed(2)), 2);
             }
         }
         gData.gameData.init_coin = false;

+ 2 - 0
assets/script/game/module/reward/Reward.ts

@@ -248,6 +248,8 @@ export default class Reward extends cc.Component {
      * 提现操作
      */
     private clickCashOut() {
+        gData.reward.addReward();
+        mk.ui.closePanel(this.node.name);
         let path = 'module/redBagCash/redBagCash';
         mk.ui.openPanel(path);
     }

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

@@ -108,11 +108,13 @@ export default class Sign extends cc.Component {
     private initBtnStyle() {
         if (gData.gameData.gameData.isSignInToday == 0 && gData.sign.haveSignDay()) {
             this.anim_btn.play();
-            this.anim_btn.getComponent('SetGray').setGray(false);
+            // this.anim_btn.getComponent(SetGray).setGray(false);
+            this.anim_btn.getComponent(mk.component.SetGray).setGray(false)
         } else {
             this.anim_btn.stop();
             this.anim_btn.node.scale = 1;
-            this.anim_btn.getComponent('SetGray').setGray(true);
+            // this.anim_btn.getComponent('SetGray').setGray(true);
+            this.anim_btn.getComponent(mk.component.SetGray).setGray(true)
         }
         gData.sign.init_data = false;
     }

+ 23 - 0
assets/script/mk/system/MKSystem.ts

@@ -22,6 +22,8 @@ import TweenUtil from "../utils/TweenUtil";
 import FlySystem from "./FlySystem";
 import GuideSystem from "./GuideSystem";
 import StringUtil from "../utils/StringUtil";
+import SetGray from "../../game/component/SetGray";
+import NumberAnim from "../../game/component/NumberAnim";
 
 /**
  * @description mk系统
@@ -142,9 +144,30 @@ class MKSystem {
     public set fly(v: FlySystem) {
         this._fly = v;
     }
+
+    /** mk组件类型,此处仅返回类型 */
+    private _component: comp_type
+    /** 组件类型 */
+    public get component(): comp_type {
+        return this._component || (this._component = new comp_type());
+    }
 }
 
+/**
+ * 组件类型
+ */
+class comp_type {
+    /** 置灰组件 */
+    get SetGray() {
+        return SetGray;
+    }
+    /** 置灰组件 */
+    get NumberAnim() {
+        return NumberAnim;
+    }
+}
 declare global {
+    /** 牛逼的梦嘉引擎 */
     const mk: MKSystem;
 }
 window['mk'] = new MKSystem();