zouyong 5 anni fa
parent
commit
e9e24a3699

+ 39 - 0
assets/script/game/component/tween/TweenCast.ts

@@ -0,0 +1,39 @@
+
+const { ccclass, property } = cc._decorator;
+/**
+ * 世界公告 滚动播放
+ * @author 邹勇
+ */
+@ccclass
+export default class TweenCast extends cc.Component {
+    @property({ type: cc.RichText, displayName: "公告内容" })
+    private rich_text: cc.RichText = null;
+    @property({ displayName: "显示时间" })
+    private display_time: number = 5;
+    @property({ displayName: "进出速度" })
+    private move_speed: number = 2;
+    @property({ displayName: "等待时间" })
+    private wait_time: number = 10;
+
+    onLoad() {
+        this.reset();
+    }
+
+    start() {
+        cc.tween(this.node)
+            .delay(3)
+            .call(() => {
+                this.node.active = true;
+            }, this)
+            .to(3, { x: 100 })
+            .delay(5)
+            .to(3, { x: -100 })
+            .call(this.reset.bind(this))
+            .union().repeatForever().start();
+    }
+
+    private reset() {
+        this.node.active = false;
+        this.rich_text.node.x = 250;
+    }
+}

+ 9 - 0
assets/script/game/component/tween/TweenCast.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "289efd1d-9d51-404c-bd03-39be0d598c26",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

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

@@ -15,6 +15,9 @@ export class GameData {
 
 
     public configs: any = {};
+    /** 功能开启 */
+    public funOpenData:string[] = [];
+
     public gameData: PlayerInfoType;
 
     public props: Map<number, number>;
@@ -40,7 +43,7 @@ export class GameData {
             }
             return;
         }
-        this.configs = response.data;
+        this.initConfigs(response.data);
 
         data = {};
         response = await mk.http.sendData('getInfoCrypt', data);
@@ -61,6 +64,11 @@ export class GameData {
         this.dataFinish = true;
     }
 
+    private initConfigs(data){
+        this.configs = data;
+        this.funOpenData = this.configs.ServerConfig.ServerConfig.split(",");
+    }
+
     /**
      * 保存单个数据
      */

+ 19 - 13
assets/script/game/game/FunBtns.ts

@@ -1,18 +1,23 @@
+import { Fun } from "../data/GData";
 
 const { ccclass, property } = cc._decorator;
 
 @ccclass
 export default class FunBtns extends cc.Component {
-    @property({ type: cc.Node, displayName: "存钱罐" })
+    @property({ type: cc.Node, displayName: "互推" })
     btn1: cc.Node = null;
     @property({ type: cc.Node, displayName: "转盘" })
     btn2: cc.Node = null;
-    @property({ type: cc.Node, displayName: "签到" })
+    @property({ type: cc.Node, displayName: "裂变" })
     btn3: cc.Node = null;
-    @property({ type: cc.Node, displayName: "提现" })
+    @property({ type: cc.Node, displayName: "存钱罐" })
     btn4: cc.Node = null;
-    @property({ type: cc.Node, displayName: "互推" })
+    @property({ type: cc.Node, displayName: "福袋" })
     btn5: cc.Node = null;
+    @property({ type: cc.Node, displayName: "签到" })
+    btn6: cc.Node = null;
+    @property({ type: cc.Node, displayName: "常规提现" })
+    btn7: cc.Node = null;
 
     onLoad() {
 
@@ -24,24 +29,25 @@ export default class FunBtns extends cc.Component {
     }
 
     init() {
-        // data功能开启
-        let data = [1, 1, 1, 1, 1];
+        let data = gData.gameData.funOpenData;
         for (let i = 0; i < data.length; i++) {
-            if (data[i] == 0) {
-                this['btn' + (i + 1)].active = data[i] == 1;
+            if (data[i] == '0') {
+                this['btn' + (i + 1)].active = data[i] == "1";
             }
         }
+        this.updateRedeem();
+    }
+
+    private updateRedeem() {
+        this.btn1.active = gData.redeem.showBtn;
     }
 
 
     update() {
         if (gData.redeem.init_btnChange) {
-            gData.redeem.showBtn
+            this.updateRedeem();
+            gData.redeem.init_btnChange = false;
         }
     }
-
-    lateUpdate() {
-        gData.redeem.init_btnChange = false;
-    }
 }
 

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

@@ -26,8 +26,6 @@ export default class Game extends cc.Component {
     btn_getRed3: cc.Node = null;
     @property({ type: cc.Button, displayName: "开始游戏" })
     btn_start: cc.Button = null;
-    @property({ type: cc.RichText, displayName: "公告" })
-    rich_cast: cc.RichText = null;
 
     onLoad() {
         mk.ui.closePanel("login");