예제 #1
0
        private void LoadModulesFromDllFile(string copiedDllFile)
        {
            List <IService>               services       = AuroraModuleLoader.LoadPlugins <IService>(copiedDllFile);
            List <IApplicationPlugin>     appPlugins     = AuroraModuleLoader.LoadPlugins <IApplicationPlugin>(copiedDllFile);
            List <INonSharedRegionModule> nsregionModule =
                AuroraModuleLoader.LoadPlugins <INonSharedRegionModule>(copiedDllFile);

            foreach (IService service in services)
            {
                service.Initialize(m_config, m_registry);
                service.Start(m_config, m_registry);
                service.FinishedStartup();
            }
            foreach (IApplicationPlugin plugin in appPlugins)
            {
                plugin.PreStartup(m_registry.RequestModuleInterface <ISimulationBase>());
                plugin.Initialize(m_registry.RequestModuleInterface <ISimulationBase>());
                plugin.PostInitialise();
                plugin.Start();
                plugin.PostStart();
            }
            IRegionModulesController rmc     = m_registry.RequestModuleInterface <IRegionModulesController>();
            ISceneManager            manager = m_registry.RequestModuleInterface <ISceneManager>();

            if (manager != null)
            {
                foreach (INonSharedRegionModule nsrm in nsregionModule)
                {
                    nsrm.Initialise(m_config);
                    nsrm.AddRegion(manager.Scene);
                    nsrm.RegionLoaded(manager.Scene);
                    rmc.AllModules.Add(nsrm);
                }
            }
        }