瀏覽代碼

修改地图

hwt 6 年之前
父節點
當前提交
c857459c81
共有 3 個文件被更改,包括 23 次插入13 次删除
  1. 3 0
      assets/scene/game.fire
  2. 18 12
      assets/scripts/Game.js
  3. 2 1
      assets/scripts/notice/ToastCtrl.js

+ 3 - 0
assets/scene/game.fire

@@ -277,6 +277,9 @@
     },
     "talentPoint": {
       "__id__": 181
+    },
+    "cityMapPrefab": {
+      "__uuid__": "16c23422-304e-4985-8a14-aed42859de40"
     }
   },
   {

+ 18 - 12
assets/scripts/Game.js

@@ -64,6 +64,8 @@ cc.Class({
         levelHomeSpeedUpTipsNode: cc.Node,
 
         talentPoint: cc.Node,
+
+        cityMapPrefab: cc.Prefab,
     },
 
 
@@ -138,7 +140,6 @@ cc.Class({
 
         this.levelHomeSpeedUpTips = this.levelHomeSpeedUpTipsNode.getComponent('LevelHomeSpeedUpTip');
 
-
         // this.scheduleOnce(() => {
         //     Global.devCityId = 2;
         //     this.gameFSM.visitcitymap(true);
@@ -549,17 +550,22 @@ cc.Class({
         if (this.cityMap) {
             this.cityMap.show(showAnim, devCityId);
         } else {
-            cc.loader.loadRes('/prefabs/map', cc.Prefab, (error, prefab) => {
-                if (error === null) {
-                    this.cityMap = cc.instantiate(prefab);
-                    cc.find('Canvas').addChild(this.cityMap);
-                    this.cityMap = this.cityMap.getComponent('CityMapCtrl');
-                    this.cityMap.init(this);
-                    this.cityMap.show(showAnim, devCityId);
-                } else {
-                    console.log(JSON.stringify(error));
-                }
-            });
+            this.cityMap = cc.instantiate(this.cityMapPrefab);
+            cc.find('Canvas').addChild(this.cityMap);
+            this.cityMap = this.cityMap.getComponent('CityMapCtrl');
+            this.cityMap.init(this);
+            this.cityMap.show(showAnim, devCityId);
+            // cc.loader.loadRes('/prefabs/map', cc.Prefab, (error, prefab) => {
+            //     if (error === null) {
+            //         this.cityMap = cc.instantiate(prefab);
+            //         cc.find('Canvas').addChild(this.cityMap);
+            //         this.cityMap = this.cityMap.getComponent('CityMapCtrl');
+            //         this.cityMap.init(this);
+            //         this.cityMap.show(showAnim, devCityId);
+            //     } else {
+            //         console.log(JSON.stringify(error));
+            //     }
+            // });
         }
         // this._hideLevelHome();
 

+ 2 - 1
assets/scripts/notice/ToastCtrl.js

@@ -13,6 +13,7 @@ cc.Class({
     },
 
     show(message) {
+        clearInterval(this.timer);
         this.label.string = message;
         this.node.active = true;
         this.node.y = - this.node.height;
@@ -20,7 +21,7 @@ cc.Class({
         this.node.runAction(anim);
         this.timer = setInterval(() => {
             this.close();
-        }, 1000);
+        }, 2000);
     },
 
     // update (dt) {},