Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IEnumerator CheckInternetConnection(Action<bool> action){
- bool isConnected = false;
- WWW www = new WWW("Address you want to ping");
- yield return www;
- if (www.error != null) {
- isConnected = false;
- } else {
- if (www.text.Contains("Content")) {
- isConnected = true;
- } else {
- isConnected = false;
- }
- }
- if (action != null) {
- action (isConnected);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement