56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using Cysharp.Threading.Tasks;
|
|
using Framework;
|
|
using Gameplay;
|
|
using Gameplay.Net;
|
|
|
|
public class GameClientReconnect
|
|
{
|
|
private static bool _isReconnecting;
|
|
public static void BackToStart()
|
|
{
|
|
_isReconnecting = false;
|
|
GameStateManager.Instance.ChangeState(new GameStateStart());
|
|
Actor.Instance.OnLogout();
|
|
Actor.Instance.SetIsReconnecting(_isReconnecting);
|
|
}
|
|
|
|
public static void StartReconnect()
|
|
{
|
|
_isReconnecting = true;
|
|
Actor.Instance.SetIsReconnecting(_isReconnecting);
|
|
_OpenReconnectingUI();
|
|
}
|
|
|
|
public static void EndReconnect()
|
|
{
|
|
_isReconnecting = false;
|
|
_CloseReconnectingUI();
|
|
Actor.Instance.SetIsReconnecting(_isReconnecting);
|
|
}
|
|
|
|
public static void ReconnectConfirm()
|
|
{
|
|
_OpenReconnectConfirmUI();
|
|
_CloseReconnectingUI();
|
|
}
|
|
|
|
public static void ReconnectAgain()
|
|
{
|
|
EventManager.Instance.Send(EventManager.EventName.NetReloginAgain);
|
|
}
|
|
|
|
private static void _OpenReconnectingUI()
|
|
{
|
|
UINetManager.Instance.ShowReconnect();
|
|
}
|
|
|
|
private static void _CloseReconnectingUI()
|
|
{
|
|
UINetManager.Instance.HideReconnect();
|
|
}
|
|
|
|
private static void _OpenReconnectConfirmUI()
|
|
{
|
|
UINetManager.Instance.ShowReconnectConfirm();
|
|
}
|
|
} |