Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

Problem exporting solution to WebGL

$
0
0
Good morning, I'm using Unity 5.3.3f1 Personal and into my code I have to use the Unity Ping class ( http://docs.unity3d.com/ScriptReference/Ping.html ). The building and execution in internal Unity Player (attached image) runs properly. However when I try to export this solution to WebGL, I recieve the next error: "error CS0246: The type or namespace name 'Ping' could not be found. Are you missing a using directive or an assembly reference?" This is the C# source code with the related Ping code: using UnityEngine; using System.Collections; using System.Text; using System.Collections.Generic; using LitJson; public class PingScript : MonoBehaviour { string Url = null, pingAddress = "192.168.0.180"; float pingStartTime; // Use this for initialization void Start() { CheckServerIp(); if (Url == null) { pingAddress = "192.168.1.210"; CheckServerIp(); } print(Url); } // Update is called once per frame void Update() { if (Url != null) { //Do something } } void CheckServerIp() { bool internetPossiblyAvailable; switch (Application.internetReachability) { case NetworkReachability.ReachableViaLocalAreaNetwork: internetPossiblyAvailable = true; break; default: internetPossiblyAvailable = false; break; } if (!internetPossiblyAvailable) { Url = null; } Ping ping = new Ping(pingAddress); pingStartTime = Time.time; if (ping != null) { if (ping.isDone) { if (ping.time >= 0) { Url = "http://" + pingAddress + ":3200/api/pumpvalues"; } } } } } ![alt text][1] [1]: /storage/temp/67578-unityinternalplayer.jpg Kind regards.

Viewing all articles
Browse latest Browse all 2390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>