Skip to content

wai-yan-zaw-win/SimpleInternetChecker

Repository files navigation

Unity SimpleInternetChecker

This package contains simple drag and drop internet connection checker for Unity. It uses UnityWebRequest to send and get WebRequest from Google.

How to Use

It is pretty simple actually. Just drag and drop SimpleInternetChecker Prefab from HarioGames/Examples/Prefabs/ .

Prefab Image

Checking Conditions

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");
            }
        }
    }
}

Contacts :

You can contact me via waiyanzawwinstar8@gmail.com.

Social Medias :

Wai Yan Zaw Win | Facebook Wai Yan Zaw Win | Instagram Wai Yan Zaw Win | LinkedIn


Releases

No releases published

Packages

No packages published

Languages