NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Game/Reconnnect/GameReconnectMgr.cs

37 lines
699 B
C#

using Framework;
using Gameplay.Net;
using PhxhSDK;
using UnityEngine;
public class GameReconnectMgr: Singlenton<GameReconnectMgr>, IInitable, IUpdatable
{
private bool _isNeedCheckNet;
public void Init()
{
}
public void Release()
{
}
public void Update(float dt)
{
if (!Application.isFocused && !_isNeedCheckNet)
{
_isNeedCheckNet = true;
}
//切回来时需检测网络
if (Application.isFocused && _isNeedCheckNet)
{
Actor.Instance.Login.CurrentStatus.CheckNet();
_isNeedCheckNet = false;
}
}
}