|
@@ -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();
|
|
|
|