Exemple #1
0
 private void OnDestroy()
 {
     TreeController.OnLoadingContent -= onTreeControllerLoadingContent;
     TreeController.OnContentLoaded  -= onTreeControllerContentLoaded;
     if (loadingController.HasLoadingSystem(this))
     {
         loadingController.RemoveLoadingSystem(this);
     }
 }
 public virtual void ResumeSession()
 {
     if (HasSession)
     {
         if (Service.Get <ConnectionManager>().ConnectionState == ConnectionManager.NetworkConnectionState.NoConnection)
         {
             Service.Get <EventDispatcher>().DispatchEvent(default(SessionErrorEvents.NoNetworkOnResumeError));
             return;
         }
         LoadingController loadingController = Service.Get <LoadingController>();
         if (!loadingController.HasLoadingSystem(this))
         {
             loadingController.AddLoadingSystem(this);
         }
         mixSession.Resume(delegate(IResumeSessionResult result)
         {
             if (!result.Success)
             {
                 Service.Get <EventDispatcher>().DispatchEvent(default(SessionErrorEvents.NoSessionOnResumeError));
             }
             else
             {
                 eventDispatcher.DispatchEvent(default(SessionEvents.SessionResumedEvent));
             }
             Service.Get <LoadingController>().RemoveLoadingSystem(this);
         });
     }
     else
     {
         Service.Get <EventDispatcher>().DispatchEvent(default(SessionErrorEvents.NoSessionOnResumeError));
     }
 }
Exemple #3
0
 private bool onLotScreenReady(IglooUIEvents.LotScreenReady evt)
 {
     if (loadingController.HasLoadingSystem(this))
     {
         loadingController.RemoveLoadingSystem(this);
     }
     return(false);
 }
 public void OnDestroy()
 {
     if (avatarDetailsData != null)
     {
         avatarDetailsData.PlayerOutfitChanged -= onPlayerOutfitChanged;
         avatarDetailsData.PlayerColorChanged  -= onPlayerColorChanged;
     }
     if (avatarView != null)
     {
         avatarView.OnBusy  -= avatarView_OnBusy;
         avatarView.OnReady -= avatarView_OnReady;
     }
     if (loadingController != null && loadingController.HasLoadingSystem(this))
     {
         loadingController.RemoveLoadingSystem(this);
     }
 }
Exemple #5
0
    private void sceneTransition(string sceneName, string transitionScene, Dictionary <string, object> sceneArgs = null, bool allowSceneActivation = false)
    {
        Time.timeScale = 1f;
        LoadingController loadingController = Service.Get <LoadingController>();

        if (!loadingController.HasLoadingSystem(this))
        {
            loadingController.AddLoadingSystem(this);
        }
        if (string.IsNullOrEmpty(transitionScene))
        {
            transitionScene = "Loading";
        }
        TransitionState = ZoneTransitionEvents.ZoneTransition.States.Begin;
        dispatcher.DispatchEvent(new ZoneTransitionEvents.ZoneTransition(CurrentZone.SceneName, sceneName, ZoneTransitionEvents.ZoneTransition.States.Begin));
        dispatcher.AddListener <SceneTransitionEvents.TransitionComplete>(onSceneLoadComplete);
        Service.Get <SceneTransitionService>().LoadScene(sceneName, transitionScene, sceneArgs, allowSceneActivation);
    }
Exemple #6
0
        private IEnumerator loadPrefab()
        {
            AssetRequest <GameObject> request = Content.LoadAsync <GameObject>(PrefabToLoad.Key);

            yield return(request);

            if (request.Asset != null)
            {
                Object.Instantiate(request.Asset, base.transform);
            }
            else
            {
                Log.LogErrorFormatted(this, "Failed to load prefab for content key {0}", PrefabToLoad.Key);
            }
            LoadingController loadingController = Service.Get <LoadingController>();

            if (loadingController.HasLoadingSystem(this))
            {
                loadingController.RemoveLoadingSystem(this);
            }
        }
Exemple #7
0
 public override void ResumeSession()
 {
     if (HasSession)
     {
         if (Service.Get <ConnectionManager>().ConnectionState == ConnectionManager.NetworkConnectionState.NoConnection)
         {
             Service.Get <EventDispatcher>().DispatchEvent(default(SessionErrorEvents.NoNetworkOnResumeError));
             return;
         }
         LoadingController loadingController = Service.Get <LoadingController>();
         if (!loadingController.HasLoadingSystem(this))
         {
             loadingController.AddLoadingSystem(this);
         }
         CoroutineRunner.StartPersistent(delayResume(), this, "delay resume");
     }
     else
     {
         Service.Get <EventDispatcher>().DispatchEvent(default(SessionErrorEvents.NoSessionOnResumeError));
     }
 }
        private void applicationPause(bool isPaused)
        {
            if (SceneManager.GetActiveScene().name == "Boot" || (Service.IsSet <MembershipService>() && Service.Get <MembershipService>().IsPurchaseInProgress))
            {
                return;
            }
            LoadingController loadingController = Service.Get <LoadingController>();

            if (Service.IsSet <SessionManager>() && Service.Get <SessionManager>().HasSession)
            {
                if (isPaused)
                {
                    Service.Get <SessionManager>().PauseSession(immediately: true);
                    if (!loadingController.HasLoadingSystem(this))
                    {
                        loadingController.AddLoadingSystem(this);
                    }
                }
                else
                {
                    IsAppResuming = true;
                    Service.Get <SessionManager>().ResumeSession();
                }
            }
            if (Service.IsSet <ICPSwrveService>())
            {
                if (isPaused)
                {
                    Service.Get <ICPSwrveService>().Pause();
                }
                else
                {
                    Service.Get <ICPSwrveService>().Resume();
                }
            }
            if (!isPaused)
            {
                loadingController.RemoveLoadingSystem(this);
            }
        }
Exemple #9
0
 public override void OnEnter()
 {
     SuspendActiveQuest();
     if (stateController != null)
     {
         if (stateController.IsFirstIglooLoad && Service.Get <SceneLayoutDataManager>().IsInOwnIgloo())
         {
             stateController.OpenManageIglooPopup();
         }
         stateController.SendContextEvent("IglooScreenContainerContent", "igloolotsevent");
     }
     loadingController = Service.Get <LoadingController>();
     if (!loadingController.HasLoadingSystem(this))
     {
         loadingController.AddLoadingSystem(this);
     }
     eventChannel.AddListener <IglooUIEvents.SetStateButtonPressed>(onSceneStateButton);
     eventChannel.AddListener <IglooUIEvents.CreateIglooButtonPressed>(onManageIglooCreatePressed);
     eventChannel.AddListener <IglooUIEvents.CloseManageIglooPopup>(onCloseManageIglooPopup);
     eventChannel.AddListener <IglooUIEvents.LotNextButtonPressed>(onLotNextButtonPressed);
     eventChannel.AddListener <IglooUIEvents.LotBackButtonPressed>(onLotBackButtonPressed);
     eventChannel.AddListener <IglooUIEvents.LotScreenReady>(onLotScreenReady);
 }