unity3d check if there is internet connection code example
Example: unity check if device has wifi
public bool internetConnectivity()
{
UnityWebRequest request = UnityWebRequest.Get("https://www.google.com/");
request.SendWebRequest();
if (request.error != null)
{
Debug.LogWarning("No internet connection");
return false;
}
else
{
return true;
}
}