hwt vor 6 Jahren
Ursprung
Commit
c857459c81
3 geänderte Dateien mit 23 neuen und 13 gelöschten Zeilen
  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) {},