Example #1
0
        public void Init(NetworkServerManager netManager)
        {
            this.netManager = netManager;

            allService.Clear();

            Type[] childTypes = ReflectionTool.FastGetChildTypes(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.FastGetChildTypes(typeof(ClientControllerBase));

            foreach (var item in childTypes)
            {
                if (item.IsAbstract)
                {
                    continue;
                }
                Add(item);
            }

            foreach (var item in allService)
            {
                item.Value.OnInit();
            }
        }