unity check for internet connection

Code Example - unity check for internet connection

                
                        //REACHABLE VIA LOCAL NETWORK OR CARRIER DATA
if (Application.internetReachability != NetworkReachability.NotReachable)
{
     Debug.LogWarning("Connected to WiFi or Carrier network");
}