using UnityEngine;
|
using UnityEngine.UI;
|
|
|
public class ServerForceExitHintWin : UIBase
|
{
|
public static int reason = 0;
|
|
[SerializeField] Text m_Reason;
|
[SerializeField] Button m_Confirm;
|
|
#region Built-in
|
|
protected override void InitComponent()
|
{
|
m_Confirm.AddListener(ReturnToLogin);
|
}
|
|
protected override void OnPreOpen()
|
{
|
var kickConfig = KickOutReasonConfig.Get(reason);
|
m_Reason.text = kickConfig == null ? "" : kickConfig.kickout;
|
}
|
|
|
|
protected override void OnPreClose()
|
{
|
}
|
|
|
#endregion
|
|
private void ReturnToLogin()
|
{
|
reason = 0;
|
CloseWindow();
|
if (!(StageManager.Instance.currentStage == StageName.Login))
|
{
|
GameNetSystem.Instance.LoginOut();
|
}
|
}
|
|
}
|
|
|