Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static IEnumerator InternetConnection(Action<bool> done, float waitTime = 2)
- {
- UnityWebRequest www = UnityWebRequest.Get("http://google.com");
- yield return www;
- yield return new WaitForSeconds(waitTime);
- if (www.error != null)
- {
- done(false);
- }
- else
- {
- done(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement