using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Net : MonoBehaviour { public Text StrText; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (Application.internetReachability==NetworkReachability.ReachableViaCarrierDataNetwork) { StrText.text = "数据网络"; } else if (Application.internetReachability==NetworkReachability.ReachableViaLocalAreaNetwork) { StrText.text = "WIFI"; }else if (Application.internetReachability==NetworkReachability.NotReachable) { StrText.text = "没网"; } } }