unity工具————网络判断

 static class Tools
{
    //是否是WIFI
    public static bool IsWiFI{ get { return Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork; } }
    //是否是移动网络
    public static bool Is4G{ get { return Application.internetReachability == NetworkReachability.ReachableViaCarrierDataNetwork; } }
    //网络是否不可用
    public static bool IsNotReachable{ get { return Application.internetReachability == NetworkReachability.NotReachable; } }

}

你可能感兴趣的:(初级,Unity)