/// <summary> /// 停止网络线程 /// </summary> private void ShutdownNetThread() { switch (LMDataOcean.mCurThreadMode) { case eDemoThreadMode.LMN: { if (MLogicCore.IsValid) { MLogicCore.Instance.DetachNode(NLogicCore.Instance); } } break; case eDemoThreadMode.LM_N: case eDemoThreadMode.L_M_N: default: { if (mNetThread != null) { mNetThread.Stop(); } } break; } mNetThread = null; UnityEngine.Debug.LogWarning("Entrance.ShutdownNetThread: finished"); }
/// <summary> /// 启动网络线程 /// </summary> private void InitNetThread() { switch (LMDataOcean.mCurThreadMode) { case eDemoThreadMode.LMN: { if (MLogicCore.IsValid) { MLogicCore.Instance.AttachNode(new NLogicCore()); } } break; case eDemoThreadMode.LM_N: case eDemoThreadMode.L_M_N: default: { NLogicCore nLogicCore = new NLogicCore(); mNetThread = new DemoGameThread(); mNetThread.Start(nLogicCore); } break; } }