if (Application.internetReachability == NetworkReachability.NotReachable) {
Debugger.Log (“没有联网!!!”);
}
if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork) {
Debugger.Log (“使用Wi-Fi!!!”);
}
if (Application.internetReachability == NetworkReachability.ReachableViaCarrierDataNetwork) {
Debugger.Log (“使用移动网络!!!”);
}
注意,请不要使用此属性来确定实际的连接。例如该设备可以连接到一个热点,但不具有连网络的实际路由。非手持设备被认为总是能够联网