Check for internet connectivity from Unity

后端 未结 6 1969
轮回少年
轮回少年 2020-12-07 00:41

I have a Unity project which I build for Android and iOS platforms. I want to check for internet connectivity on Desktop, Android, and iOS devices. I\'ve read about three di

6条回答
  •  萌比男神i
    2020-12-07 01:04

    You can check network connection using this code

    if(Application.internetReachability == NetworkReachability.NotReachable){
           Debug.Log("Error. Check internet connection!");
    }
    

提交回复
热议问题