|   | 
| using System;  | 
| using System.Collections;  | 
| using System.Collections.Generic;  | 
| using UnityEngine;  | 
| using UnityEngine.SceneManagement;  | 
| using UnityEngine.UI;  | 
|   | 
|   | 
| public class DisconnectHintWin : UIBase  | 
| {  | 
|     [SerializeField] Text m_Content;  | 
|     [SerializeField] Button m_Confirm;  | 
|     [SerializeField] Button m_Cancel;  | 
|   | 
|     #region Built-in  | 
|   | 
|     protected override void InitComponent()  | 
|     {  | 
|         m_Cancel.AddListener(Cancel);  | 
|         m_Confirm.AddListener(Confirm);  | 
|     }  | 
|   | 
|     protected override void OnPreOpen()  | 
|     {  | 
|         if (StageManager.Instance.currentStage == StageName.Login)  | 
|         {  | 
|             m_Content.text = Language.Get("Disconnected_2");  | 
|         }  | 
|         else  | 
|         {  | 
|             m_Content.text = Language.Get("Disconnected_1");  | 
|         }  | 
|     }  | 
|   | 
|     #endregion  | 
|   | 
|     private void Confirm()  | 
|     {  | 
|         switch (Application.internetReachability)  | 
|         {  | 
|             case NetworkReachability.NotReachable:  | 
|                 GameNetSystem.Instance.LoginOut();  | 
|                 ServerForceExitHintWin.reason = 111;  | 
|                 break;  | 
|             case NetworkReachability.ReachableViaCarrierDataNetwork:  | 
|             case NetworkReachability.ReachableViaLocalAreaNetwork:  | 
|                 if (StageManager.Instance.currentStage == StageName.Login)  | 
|                 {  | 
|                     LoginManager.Instance.busy = false;  | 
|                     LoginManager.Instance.AccountLogin(LoginManager.Instance.accountBuf, LoginManager.Instance.ipBuf,  | 
|                     LoginManager.Instance.portBuf, LoginManager.Instance.gamePortBuf);  | 
|                 }  | 
|                 else  | 
|                 {  | 
|                     GameNetSystem.Instance.Reconnect();  | 
|                 }  | 
|                 break;  | 
|         }  | 
|   | 
|         CloseWindow();  | 
|     }  | 
|   | 
|     private void Cancel()  | 
|     {  | 
|         if (!(StageManager.Instance.currentStage == StageName.Login))  | 
|         {  | 
|             GameNetSystem.Instance.LoginOut();  | 
|         }  | 
|   | 
|         CloseWindow();  | 
|     }  | 
|   | 
| }  | 
|   | 
|   | 
|   | 
|   | 
|   |