public PreloadManager(IApplicationStateStack <AppState> stateStack, IScenePreloader preloader)
        {
            m_Preloader = preloader;
            stateStack.AddDelegate(this);

            stateStack.SetPreprocessAction(OnStackPreprocess);
            stateStack.SetPostprocessAction(OnStackPostprocess);
        }
Пример #2
0
        public void PreparePreloader(Action onInit)
        {
            Load(AppConfig.DefaultPreloaderSceneName, sceneManager =>
            {
                Preloader = (IScenePreloader)sceneManager;
                Assert.IsNotNull(Preloader);

                onInit.Invoke();
            });
        }
Пример #3
0
        public void PreparePreloader(Action onInit)
        {
            Load <ISceneManager>(AppConfig.MobilePreloaderSceneName, (scene, sceneManager) =>
            {
                Preloader = (IScenePreloader)sceneManager;
                Assert.IsNotNull(Preloader);

                onInit.Invoke();
            });
        }
 public void Load <T>(IScenePreloader preloader, string sceneName, Action <Scene, T> onComplete) where T : ISceneManager
 {
     preloader.FadeIn(() =>
     {
         Load <T>(sceneName, (scene, sceneManager) =>
         {
             preloader.FadeOut(() =>
             {
                 onComplete?.Invoke(scene, sceneManager);
             });
         });
     });
 }
Пример #5
0
 public void Load(IScenePreloader preloader, string sceneName, Action <ISceneManager> onComplete)
 {
     preloader.FadeIn(() =>
     {
         Load(sceneName, sceneManager =>
         {
             preloader.FadeOut(() =>
             {
                 onComplete?.Invoke(null);
             });
         });
     });
 }
 /// <summary>
 /// Sets preloader implementation.
 /// The `1f` will be artificially sent to <see cref="IScenePreloader.OnProgress"/> once scene load completed.
 /// </summary>
 /// <param name="preloader">Preloader implementation</param>
 public void SetPreloader(IScenePreloader preloader)
 {
     m_Preloader = preloader;
 }