コード例 #1
0
 public void SwitchMapResp(short state, SwitchMapRes down = null)
 {
     try
     {
         Debug.Log("切换地图: " + down.newMapId);
         if (state != 0)
         {
             StateManager.Instance.StateShow(state, 0);
             throw new Exception("state :" + state);
         }
         if (EntityWorld.Instance.EntSelf != null && EntityWorld.Instance.ActSelf)
         {
             EntityWorld.Instance.AddPosRecord(EntityWorld.Instance.EntSelf.ID, EntityWorld.Instance.EntSelf.Actor.FixTransform.get_position(), -1);
         }
         EventDispatcher.Broadcast(SceneManagerEvent.ClearSceneDependentLogic);
         if (MySceneManager.IsCityWildScene(down.oldMapId) || MySceneManager.IsCityWildScene(down.newMapId))
         {
             down.selfObj.pos = null;
         }
         if (EntityWorld.Instance.EntSelf != null)
         {
             EntityWorld.Instance.EntSelf.SetDataByMapObjInfo(down.selfObj, false, down.transformId);
         }
         if (down.oldMapId != down.newMapId || (down.oldMapId == down.newMapId && MySceneManager.IsMainScene(down.newMapId)))
         {
             this.IsSceneExist  = false;
             this.lastSceneType = this.curSceneType;
             this.curSceneType  = ((!MySceneManager.IsMainScene(down.newMapId)) ? SceneType.Battle : SceneType.City);
             Loading.Instance.OnStartLoad(down.newMapId, down.otherObjs);
         }
         else
         {
             AOIService.Instance.SetMapArrivedObj(down.otherObjs);
         }
     }
     catch (Exception ex)
     {
         DialogBoxUIViewModel.Instance.ShowAsConfirm("错误", string.Format("切换地图时出错 :{0} {3} {1} version: {2}", new object[]
         {
             DateTime.get_Now().ToString("yyyy/MM/dd HH:mm:ss"),
             down.newMapId,
             GameManager.Instance.GetLocalVersionsString(),
             state
         }), null, "确定", "button_orange_1", UINodesManager.T4RootOfSpecial);
         throw new MySceneManager.SwitchMapException(string.Concat(new object[]
         {
             "mapID:",
             down.newMapId,
             " state:",
             state
         }), ex);
     }
 }
コード例 #2
0
 public bool IsWorldMapSwitch(int sceneID)
 {
     return(MySceneManager.IsCityWildScene(sceneID) || MySceneManager.IsCityWildScene(MySceneManager.Instance.CurSceneID));
 }