This package contains simple drag and drop internet connection checker for Unity. It uses UnityWebRequest to send and get WebRequest from Google.
It is pretty simple actually. Just drag and drop SimpleInternetChecker Prefab from HarioGames/Examples/Prefabs/ .
You might need to call the following namespace to get SimpleInternetChecker Instance.
using HarioGames.SimpleInternetChecker;
Here is an example of checking and doing something if there is intenet connection.
void FixedUpdate()
{
if(SimpleInternetChecker.Instance != null)
{
if(!SimpleInternetChecker.Instance.isInternetOn && !SimpleInternetChecker.Instance.hasInternetConnection)
{
Debug.Log("No Internet");
//Show no internet pop up or do something
}
else
{
if(!SimpleInternetChecker.Instance.hasInternetConnection)
{
Debug.Log("Checking internet connection");
}
}
}
}
You can contact me via [email protected].