| //--------------------------------------------------------  | 
| //    [Author]:           第二世界  | 
| //    [  Date ]:           Friday, November 02, 2018  | 
| //--------------------------------------------------------  | 
| using UnityEngine;  | 
| using System.Collections;  | 
| using UnityEngine.UI;  | 
|   | 
| using System.Collections.Generic;  | 
|   | 
| namespace vnxbqy.UI {  | 
|   | 
|     public class MapSwitchingBehaviour:MonoBehaviour {  | 
|         [SerializeField] Button m_Btn_MapSwitch;  | 
|         List<int> MapIdList = new List<int>();  | 
|   | 
|         DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }  | 
|   | 
|         public void InitAwake()  | 
|         {  | 
|             var config = FuncConfigConfig.Get("MapLine").Numerical4;  | 
|             int[] mapList = ConfigParse.GetMultipleStr<int>(config);  | 
|             MapIdList.Clear();  | 
|             for (int i = 0; i < mapList.Length; i++)  | 
|             {  | 
|                 MapIdList.Add(mapList[i]);  | 
|             }  | 
|         }  | 
|         public void Init()  | 
|         {  | 
|             int MapID = PlayerDatas.Instance.baseData.MapID;  | 
|             if (MapIdList.Contains(MapID) && !AdventureStage.Instance.IsInAdventureStage)  | 
|             {  | 
|                 m_Btn_MapSwitch.SetActive(true);  | 
|             }  | 
|             else  | 
|             {  | 
|                 m_Btn_MapSwitch.SetActive(false);  | 
|             }  | 
|         }  | 
|         private void Awake()  | 
|         {  | 
|              | 
|         }  | 
|         private void Start()  | 
|         {  | 
|             m_Btn_MapSwitch.AddListener(OnClickMapSwitch);  | 
|         }  | 
|         private void OnEnable()  | 
|         {  | 
|               | 
|         }  | 
|   | 
|         private void OnDisable()  | 
|         {  | 
|               | 
|         }  | 
|   | 
|         private void OnClickMapSwitch()  | 
|         {  | 
|             //if (PlayerDatas.Instance.extersion.bossState == 1)  | 
|             //{  | 
|             //    SysNotifyMgr.Instance.ShowTip("Task_Transfer1");  | 
|             //    return;  | 
|             //}  | 
|             ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),  | 
|               Language.Get("ZLMapQuit"), (bool isOk) =>  | 
|                {  | 
|                    if (isOk)  | 
|                    {  | 
|                        MapTransferUtility.Instance.Clear();  | 
|                        if (CrossServerUtility.IsCrossServerBoss())  | 
|                        {  | 
|                            var crossServerBossModel = ModelCenter.Instance.GetModel<CrossServerBossModel>();  | 
|                            crossServerBossModel.RequestExit();  | 
|                        }  | 
|                        else  | 
|                        {  | 
|                            model.ExitCurrentDungeon();  | 
|                        }  | 
|                    }  | 
|                });  | 
|         }  | 
|     }  | 
|   | 
| }  | 
|   | 
|   | 
|   |