Просмотр исходного кода

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

kaka 4 лет назад
Родитель
Сommit
b7882e2e39

+ 0 - 12
assets/resources/animation/Main.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "8c65ee95-8d1e-4deb-8864-df1c7a01c9ee",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

Разница между файлами не показана из-за своего большого размера
+ 260 - 136
assets/resources/game/coregame/coregame.prefab


+ 7 - 4
assets/resources/game/prefab/game.prefab

@@ -3135,7 +3135,7 @@
       "__uuid__": "67c98121-b632-4ccf-b772-825d32c6aa36"
     },
     "_type": 0,
-    "_sizeMode": 1,
+    "_sizeMode": 0,
     "_fillType": 0,
     "_fillCenter": {
       "__type__": "cc.Vec2",
@@ -4821,7 +4821,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "fc+CNrWZtP+I1mGqj8SElA",
+    "fileId": "6akrsKWy5DhqbOhAl2Paf8",
     "sync": false
   },
   {
@@ -5033,7 +5033,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "90lU81Nu9A/Jmcczn+/Ojz",
+    "fileId": "90mzyXQntGo43JK/z/0OZL",
     "sync": false
   },
   {
@@ -5142,7 +5142,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "a471mt9MpDh7WotDe3vOwO",
+    "fileId": "37qRC93NZGWqbnLragssN2",
     "sync": false
   },
   {
@@ -10018,6 +10018,9 @@
     "node_hand": {
       "__id__": 154
     },
+    "sp_gradeName": {
+      "__id__": 87
+    },
     "_id": ""
   },
   {

+ 8 - 8
assets/resources/module/setting/setting.prefab

@@ -1645,7 +1645,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 151,
+      "width": 150,
       "height": 39
     },
     "_anchorPoint": {
@@ -1698,7 +1698,7 @@
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_spriteFrame": {
-      "__uuid__": "98f93ff3-a228-472b-adc9-1a0385e2c403"
+      "__uuid__": "a77896c0-52c6-4ca2-8a4a-8b07deb0e8ac"
     },
     "_type": 0,
     "_sizeMode": 1,
@@ -2845,7 +2845,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 221.81,
+      "width": 146.17000000000002,
       "height": 53
     },
     "_anchorPoint": {
@@ -3031,7 +3031,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        -93.905,
+        -56.08500000000001,
         0,
         0,
         0,
@@ -3375,7 +3375,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        93.905,
+        56.084999999999994,
         0,
         0,
         0,
@@ -3472,7 +3472,7 @@
     "_enabled": true,
     "_layoutSize": {
       "__type__": "cc.Size",
-      "width": 221.81,
+      "width": 146.17000000000002,
       "height": 53
     },
     "_resize": 1,
@@ -5907,8 +5907,8 @@
       "__id__": 134
     },
     "lbl_version": null,
-    "lbl_achieve": {
-      "__id__": 35
+    "sp_achieve": {
+      "__id__": 47
     },
     "lbl_lv": {
       "__id__": 39

+ 2 - 1
assets/script/game/data/AdData.ts

@@ -104,7 +104,8 @@ export class AdData {
     }
 
 
-    public async watchVideo(type: AdFun) {
+    public async watchVideo(type: AdFun)
+    {
         this.ad_subType = type;
         let data = {
             "imei": gData.appData.machineInfo.imei,

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

@@ -1147,6 +1147,9 @@ class PlayerProp {
     //农场等级奖励数据
     farmGradeData: any = {};
 
+    //农场等级名字
+    farmGradeName: number = 1;
+
     //农场经验
     private farmExp = 0;
 

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

@@ -59,6 +59,8 @@ export default class Game extends cc.Component {
     ani_add: cc.Animation = null;
     @property({ type: cc.Node, displayName: '任务红包手' })
     node_hand: cc.Node = null;
+    @property({type: cc.Sprite, displayName: '等级名字'})
+    sp_gradeName: cc.Sprite = null;
 
 
     /** 是否开始增加次数倒计时 */
@@ -235,7 +237,7 @@ export default class Game extends cc.Component {
         gData.gameData.init_task = false;
     }
 
-    private initFarmExpUI() {
+    private async initFarmExpUI() {
         let curLevel = gData.gameData.gameData.gradeLevel;
         this.lbl_farmLevel.string = curLevel.toString();
 
@@ -246,6 +248,26 @@ export default class Game extends cc.Component {
             this.sp_levelPer.fillRange = curExp / needExp;
         }
 
+        let nameIndex= 1;
+        if(gData.gameData.gameData.farmGradeData)
+        {
+            let data = gData.gameData.gameData.farmGradeData.farmGradeRewardList;
+            if(data)
+            {
+                let len = data.length;
+                for(let i = 0; i != len; ++i)
+                {
+                    if(gData.gameData.gameData.farmExpValue >= data[i].expMax)
+                    {
+                        nameIndex = i + 1;
+                    }
+                }
+            }        
+        }
+        gData.gameData.gameData.farmGradeName = nameIndex;
+
+        this.sp_gradeName.spriteFrame = await mk.loader.load('module/gradeReward/texture/name' + nameIndex, cc.SpriteFrame); 
+
         gData.gameData.init_expLevel = false;
     }
 

+ 85 - 0
assets/script/game/game/RedPointControl.ts

@@ -0,0 +1,85 @@
+import { ProductType } from "../data/GameData";
+
+const { ccclass, property } = cc._decorator;
+
+@ccclass
+export class RedPointControl extends cc.Component {
+
+    @property({type: cc.Node, displayName: '红点节点'})
+    private node_redPoint: cc.Node = null;
+
+    start()
+    {
+        this.changeStatus();
+    }
+
+    update(dt)
+    {
+        if(gData.farmMapData.isStateChange)
+        {
+            this.changeStatus();
+        }
+    }
+
+    private changeStatus()
+    {
+        for (let key in ProductType) {
+            let max = gData.gameData.getMaxProduct(ProductType[key]);
+            if (max) {
+                let list_data = gData.gameData.getProductArrByType(ProductType[key]);        
+                for (let i = 0; i != list_data.length; ++i) {
+                    if (list_data[i].picture <= max) {
+                        let state = gData.gameData.getFarmMapRewardState(this.getIndex(list_data[i]));
+                        if (state == 0) {
+                            this.node_redPoint.active = true;
+                            return;
+                        }
+                    }
+                }
+            }
+        }
+        this.node_redPoint.active = false;
+    }
+
+    getIndex(data) {
+        let index: any = {};
+        index.i = 0;
+        index.j = 0;
+        switch (data.tab) {
+            case '农作物':
+                index.i = 0;
+                index.j = data.picture - 10001;
+                break;
+            case '动物':
+                index.i = 1;
+                index.j = data.picture - 20001;
+                break;
+            case '爆米花厂':
+                index.i = 2;
+                index.j = data.picture - 20004;
+                break;
+            case '糕点铺':
+                index.i = 3;
+                index.j = data.picture - 20013;
+                break;
+            case '制糖厂':
+                index.i = 4;
+                index.j = data.picture - 20010;
+                break;
+            case '炼乳厂':
+                index.i = 5;
+                index.j = data.picture - 20007;
+                break;
+            case '功夫面馆':
+                index.i = 6;
+                index.j = data.picture - 20025;
+                break;
+            case '快餐店':
+                index.i = 7;
+                index.j = data.picture - 20019;
+                break;
+        }
+
+        return index;
+    }
+}

+ 9 - 0
assets/script/game/game/redPointControl.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "ead93920-6192-4fec-8919-f46ab4ebab3d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 11 - 8
assets/script/game/module/farmMap/FarmItem.ts

@@ -157,16 +157,19 @@ export default class FarmItem extends cc.Component {
         mk.audio.playEffect("button");
 
         mk.ad.videoAdType = VideoAdType.video_init_6;
-        mk.ad.watchAd((success) => {
+        mk.ad.watchAd(async (success) => {
             if (success) {
-                gData.adData.watchVideo(AdFun.farmMap);
+                await gData.adData.watchVideo(AdFun.farmMap);
                 
-                gData.farmMapData.isStateChange = true;
-                this.node_getBtn.active = true;
-                this.node_ungetBtn.active = false;
-                this.node_unluckBtn.active = false;
-                this.node_redPoint.active = false;
-                gData.gameData.setFarmMapRewardState(this.getIndex(), 1);
+                if(gData.farmMapData.init_award)
+                {
+                    gData.farmMapData.isStateChange = true;
+                    this.node_getBtn.active = true;
+                    this.node_ungetBtn.active = false;
+                    this.node_unluckBtn.active = false;
+                    this.node_redPoint.active = false;
+                    gData.gameData.setFarmMapRewardState(this.getIndex(), 1);
+                }        
             }
         })
     }

+ 7 - 3
assets/script/game/module/farmMap/FarmMap.ts

@@ -84,17 +84,21 @@ export default class FarmMap extends cc.Component {
 
     update(dt) {
         if (gData.farmMapData.isStateChange) {
-            this.refreshBtnState();
-            gData.farmMapData.isStateChange = false;
+            this.refreshBtnState();      
         }
 
         if (gData.farmMapData.init_award) {
             gData.farmMapData.init_award = false;
-            gData.reward.data = gData.farmMapData.adData;
+            gData.reward.adData = gData.farmMapData.adData;
             mk.ui.openPanel('module/reward/reward');
         }
     }
 
+    lateUpdate()
+    {
+        gData.farmMapData.isStateChange = false;
+    }
+
     getIndex(data) {
         let index: any = {};
         index.i = 0;

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

@@ -66,11 +66,11 @@ export default class Reward extends cc.Component {
         if (gData.reward.add_redbag_value) {
             this.initCashOutStyle(gData.gameData.gameData.redMoney + gData.reward.add_redbag_value);
         }
-        if (gData.reward.adData) {
-            // 展示奖励
-            this.watchVideoCall();
-            return;
-        }
+        // if (gData.reward.adData) {
+        //     // 展示奖励
+        //     this.watchVideoCall();
+        //     return;
+        // }
     }
 
     lateUpdate() {

+ 3 - 2
assets/script/game/module/setting/Setting.ts

@@ -23,8 +23,8 @@ export default class Setting extends cc.Component {
     img_effect: cc.Sprite = null;
     @property({ type: cc.Label, displayName: "版本号" })
     lbl_version: cc.Label = null;
-    @property({ type: cc.Label, displayName: "成就名称" })
-    lbl_achieve: cc.Label = null;
+    @property({ type: cc.Sprite, displayName: "成就名称" })
+    sp_achieve: cc.Sprite = null;
     @property({ type: cc.Label, displayName: '等级' })
     lbl_lv: cc.Label = null;
     @property({ type: cc.Label, displayName: '红包币' })
@@ -58,6 +58,7 @@ export default class Setting extends cc.Component {
         this.img_music.spriteFrame = await mk.loader.load(music, cc.SpriteFrame);
         this.img_effect.spriteFrame = await mk.loader.load(effect, cc.SpriteFrame);
 
+        this.sp_achieve.spriteFrame =  await mk.loader.load('module/gradeReward/texture/name' + gData.gameData.gameData.farmGradeName, cc.SpriteFrame);
         console.log("=== gData.wechatData.avatar", gData.wechatData.avatar);
         let result = await mk.loader.loadRemote(gData.wechatData.avatar + "?aaa=aa.jpg", null);
         this.img_head.spriteFrame = new cc.SpriteFrame(result);

Некоторые файлы не были показаны из-за большого количества измененных файлов