コード例 #1
0
        // Token: 0x06000F01 RID: 3841 RVA: 0x00066700 File Offset: 0x00064B00
        public void start()
        {
            ModuleHook.coreNexii = new List <IModuleNexus>();
            ModuleHook.coreNexii.Clear();
            Type typeFromHandle = typeof(IModuleNexus);

            for (int i = 0; i < ModuleHook.coreTypes.Length; i++)
            {
                Type type = ModuleHook.coreTypes[i];
                if (!type.IsAbstract && typeFromHandle.IsAssignableFrom(type))
                {
                    IModuleNexus moduleNexus = Activator.CreateInstance(type) as IModuleNexus;
                    try
                    {
                        moduleNexus.initialize();
                    }
                    catch (Exception exception)
                    {
                        Debug.LogError("Failed to initialize nexus!");
                        Debug.LogException(exception);
                    }
                    ModuleHook.coreNexii.Add(moduleNexus);
                }
            }
            this.initializeModules();
        }
コード例 #2
0
        protected void initialize()
        {
            if (this.config == null || this.assemblies == null)
            {
                return;
            }
            if (this.status != EModuleStatus.None && this.status != EModuleStatus.Shutdown)
            {
                return;
            }
            this.nexii.Clear();
            Type typeFromHandle = typeof(IModuleNexus);

            for (int i = 0; i < this.types.Length; i++)
            {
                Type type = this.types[i];
                if (!type.IsAbstract && typeFromHandle.IsAssignableFrom(type))
                {
                    IModuleNexus moduleNexus = Activator.CreateInstance(type) as IModuleNexus;
                    try
                    {
                        moduleNexus.initialize();
                    }
                    catch (Exception ex)
                    {
                        Debug.LogError("Failed to initialize nexus!");
                        Debug.LogException(ex);
                    }
                    this.nexii.Add(moduleNexus);
                }
            }
            this.status = EModuleStatus.Initialized;
            if (this.onModuleInitialized != null)
            {
                this.onModuleInitialized(this);
            }
        }