public void Init(NetworkServerManager netManager) { this.netManager = netManager; allService.Clear(); Type[] childTypes = ReflectionTool.GetChildTypes(typeof(ServiceBase)); foreach (var item in childTypes) { if (item.IsAbstract) { continue; } Add(item); } foreach (var item in allService) { try { item.Value.OnInit(); } catch (Exception e) { Debug.LogError(e); } } }
////public NetControllerManager(NetworkClientManager netManager) ////{ //// this.netManager = netManager; ////} public void Init(NetworkClientManager netManager) { this.netManager = netManager; allService.Clear(); Type[] childTypes = ReflectionTool.GetChildTypes(typeof(ClientControllerBase)); foreach (var item in childTypes) { if (item.IsAbstract) { continue; } Add(item); } foreach (var item in allService) { item.Value.OnInit(); } }