Browse Source

种植飞红包

wuwangdong 4 years ago
parent
commit
e06b7df008

+ 12 - 3
assets/resources/game/prefab/game.prefab

@@ -6359,7 +6359,7 @@
     "asset": {
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
     },
-    "fileId": "dfs7DXNpZPsJWxg7N9Sm7u",
+    "fileId": "7fb0943ydK+qi+PF6rGmTG",
     "sync": false
     "sync": false
   },
   },
   {
   {
@@ -6592,7 +6592,7 @@
     "asset": {
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
     },
-    "fileId": "ffF+gE/8ZE/bsetxqjpPZd",
+    "fileId": "caq6oN8eJH0a96XHMTZ9bu",
     "sync": false
     "sync": false
   },
   },
   {
   {
@@ -6722,7 +6722,7 @@
     "asset": {
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
     },
-    "fileId": "d5jU8PV0JJRqUghKWutFGB",
+    "fileId": "5883aLFzpGkJb02lJFiqdA",
     "sync": false
     "sync": false
   },
   },
   {
   {
@@ -11522,6 +11522,15 @@
     "lbl_leftTimes": {
     "lbl_leftTimes": {
       "__id__": 315
       "__id__": 315
     },
     },
+    "lbl_task": {
+      "__id__": 194
+    },
+    "node_taskHb": {
+      "__id__": 196
+    },
+    "btn_product": {
+      "__id__": 302
+    },
     "_id": ""
     "_id": ""
   },
   },
   {
   {

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

@@ -64,6 +64,9 @@ export class GameData {
     private nextType = 0;
     private nextType = 0;
 
 
     public init_makeInfo = false;
     public init_makeInfo = false;
+
+    /** 标志位 刷新任务描述 */
+    public init_task = false;
     /**
     /**
      * 初始化游戏数据:网络配置信息,用户信息
      * 初始化游戏数据:网络配置信息,用户信息
      * @returns 
      * @returns 

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

@@ -57,8 +57,15 @@ export default class Game extends cc.Component {
     @property({ type: cc.Label, displayName: "种植次数文本" })
     @property({ type: cc.Label, displayName: "种植次数文本" })
     lbl_leftTimes: cc.Label = null;
     lbl_leftTimes: cc.Label = null;
 
 
-    @property({type: cc.Label, displayName: '任务文本'})
-    lbl_task: cc.Label = null;
+    @property({type: cc.RichText, displayName: '任务文本'})
+    lbl_task: cc.RichText = null;
+
+    @property({type: cc.Node, displayName: '任务红包节点'})
+    node_taskHb: cc.Node = null;
+
+    @property({type: cc.Node, displayName: '生产按钮节点'})
+    btn_product: cc.Node = null;
+  
 
 
     /** 是否开始增加次数倒计时 */
     /** 是否开始增加次数倒计时 */
     private leftTimesScheduleOn = false;
     private leftTimesScheduleOn = false;
@@ -136,6 +143,11 @@ export default class Game extends cc.Component {
             this.initLeftTimes();
             this.initLeftTimes();
         }
         }
 
 
+        if( gData.gameData.init_task)
+        {
+            this.changeTaskUI();
+        }
+
         if (gData.gameData.leftTimes < gData.gameData.maxTimes && this.lastTimeSpan != 0) {
         if (gData.gameData.leftTimes < gData.gameData.maxTimes && this.lastTimeSpan != 0) {
             let pass = Date.now() - this.lastTimeSpan;
             let pass = Date.now() - this.lastTimeSpan;
             if (pass >= this.span) {
             if (pass >= this.span) {
@@ -180,6 +192,8 @@ export default class Game extends cc.Component {
     private initInfo() {
     private initInfo() {
         this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
         this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
         gData.gameData.init_coin = false;
         gData.gameData.init_coin = false;
+
+        this.lbl_task.string = `<outline  color=#914128 width =2><color=#FCFDFB>完成100次收获</c><color=#66FF3D>(1/100)</color></outline>`
     }
     }
 
 
     private changeInfo() {
     private changeInfo() {
@@ -194,6 +208,13 @@ export default class Game extends cc.Component {
         //this.img_head.spriteFrame = new cc.SpriteFrame(result);
         //this.img_head.spriteFrame = new cc.SpriteFrame(result);
     }
     }
 
 
+    private changeTaskUI()
+    {
+        cc.tween(this.lbl_task.node).to(0.1, {scale: 1.2}).to(0.1, {scale: 1}).start();
+        this.lbl_task.string = `<outline  color=#914128 width =2><color=#FCFDFB>完成100次收获</c><color=#66FF3D>(1/100)</color></outline>`
+        gData.gameData.init_task = false;
+    }
+
     /**
     /**
      * 初始化红点
      * 初始化红点
      */
      */
@@ -342,6 +363,13 @@ export default class Game extends cc.Component {
         }
         }
 
 
         gData.gameData.makeProduct();
         gData.gameData.makeProduct();
+
+
+        let pos = this.node_taskHb.parent.convertToWorldSpaceAR(this.node_taskHb.getPosition());
+        mk.fly.PlayCoinAnim(1, 3, this.btn_product, pos, ()=>{
+
+            gData.gameData.init_task = true;
+        })
     }
     }
 }
 }