Check for internet connectivity from Unity

后端 未结 6 1980
轮回少年
轮回少年 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条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 01:23

    i know this is old, but maybe can help you.

    public bool CheckInternetConnection(){
        return !(Application.internetReachability == NetworkReachability.NotReachable)
    }
    

提交回复
热议问题