private static NetMessageManage Manage(ConnectResultBlock connect) { if (_instance == null) { _instance = new NetMessageManage(); _instance.ConnectSever(); _instance.ConnectBlockEvent += connect; } return(_instance); }
/// <summary> /// 连接服务器 /// </summary> /// <param name="connect">连接回调</param> public static void ConnectServer(ConnectResultBlock connect) { if (connect != null) { NetMessageManage.Manage(connect); } else { NetMessageManage.Manage(); } }
/// <summary> /// 移除连接服务器结果回调 /// </summary> public static void RemoveConnetServer(ConnectResultBlock result) { NetMessageManage.Manage().ConnectBlockEvent -= result; }