using LGS.Common_20200526; using System.Collections; using System.Collections.Generic; using UnityEngine; using XRTool.Util; public class ChangeNetWork : MonoBehaviour { void Start() { NetStatus.Instant.RegisterNetWorkChangeCallBack(NetWorkChange); } void Update() { //Debug.Log(CommonMethod.IsReceive + "AAAA"); //textMesh.text = NetStatus.Instant.SCGetNetWorkInfo(); } private void NetWorkChange(NetworkReachability preNetWorkStatus, NetworkReachability internetReachability) { //registerText.text = "网络状态变化时触发===》"+internetReachability.ToString(); switch (internetReachability) { case NetworkReachability.NotReachable: //ViewManager.Intance.ShowPop(1); break; case NetworkReachability.ReachableViaCarrierDataNetwork: break; case NetworkReachability.ReachableViaLocalAreaNetwork: //ViewManager.Intance.ShowPop(1); break; } } }