Example #1
0
        public IEnumerator OnModuleInitialize(UEngine engine)
        {
            if (hasInitialized)
            {
                yield break;
            }
            this.engine = engine;

            DebugUtility.Log(LoggerTags.Engine, "ModuleManager.OnModuleInitialize: {0}", Time.realtimeSinceStartup);
            var co = StartCoroutine(PreInitialize());

            if (co != null)
            {
                yield return(co);
            }
            co = StartCoroutine(Initialize());
            if (co != null)
            {
                yield return(co);
            }
            co = StartCoroutine(PostInitialize());
            if (co != null)
            {
                yield return(co);
            }
            DebugUtility.Log(LoggerTags.Engine, "ModuleManager.OnModuleInitialize done: {0}", Time.realtimeSinceStartup);
        }
Example #2
0
        private IEnumerator InitializeAsync(UEngine engine)
        {
            DebugUtility.Log(LoggerTags.Engine, "EngineLoop.InitializeAsync: {0}", Time.realtimeSinceStartup);
            if (!initialized)
            {
                // Initialize the preload manager
                yield return(engine.StartCoroutine(PreloadManager.GetOrAlloc().Initialize()));

                // apply engine settings
                var engineConfig = EngineSettings.GetOrLoad();
                if (engineConfig != null)
                {
                    DebugUtility.Initialize(engineConfig.loggerSettings);
                }
                // Initialize the modules
                yield return(engine.StartCoroutine(ModuleManager.Get().OnModuleInitialize(engine)));

                initialized = true;
            }

            DebugUtility.Log(LoggerTags.Engine, "EngineLoop.InitializeAsync done: {0}", Time.realtimeSinceStartup);
        }
Example #3
0
 public IEnumerator Initialize(UEngine engine)
 {
     yield return(engine.StartCoroutine(InitializeAsync(engine)));
 }