private void CheckNetworkReachability()//检测网络状态
{
if (reachability == Application.internetReachability) return;
reachability = Application.internetReachability;
switch (reachability)
{
case NetworkReachability.NotReachable:
Debug.Log("无线网络连接已断开");
// 处理网络断开的情况
break;
case NetworkReachability.ReachableViaLocalAreaNetwork:
case NetworkReachability.ReachableViaCarrierDataNetwork:
Debug.Log("连接到热点网络");
break;
}
}