using UnityEngine;
public class NwtWork : MonoBehaviour
{
private float time = 0f;
void Update()
{
time += Time.deltaTime * 1;
if (time >= 1)
{
time = 0f;
switch (Application.internetReachability)
{
case NetworkReachability.NotReachable:
Debug.LogError("网络断开");
break;
case NetworkReachability.ReachableViaLocalAreaNetwork:
Debug.LogError("WIFI");
break;
case NetworkReachability.ReachableViaCarrierDataNetwork:
Debug.LogError("4G/3G");
break;
}
}
}
}