Beispiel #1
0
        private void MiscBeforeDefaultState()
        {
            this.NotifyNewFriendRequests();
            if (HomeWindow.EnterHomeCount == 0)
            {
                this.CheckTrophies();
            }
            if (this.mNewsShown || GlobalVars.IsTitleStart.Get() || !MonoSingleton <GameManager> .Instance.Player.IsFirstLogin && !this.DebugLoginBonus)
            {
                return;
            }
            this.mNewsShown = true;
            Json_LoginBonus recentLoginBonus = MonoSingleton <GameManager> .Instance.Player.RecentLoginBonus;

            if (recentLoginBonus != null)
            {
                string iname;
                int    num;
                if (recentLoginBonus.coin > 0)
                {
                    iname = "$COIN";
                    num   = recentLoginBonus.coin;
                }
                else
                {
                    iname = recentLoginBonus.iname;
                    num   = recentLoginBonus.num;
                }
                ItemData data = new ItemData();
                if (data.Setup(0L, iname, num))
                {
                    NotifyList.PushLoginBonus(data);
                }
            }
            this.NotifySupportResult();
        }
Beispiel #2
0
 public override void Update(HomeWindow self)
 {
     if (this.state == 0)
     {
         self.mFadingOut = true;
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 11);
         this.state = 1;
     }
     if (this.state == 1)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         if (AssetManager.IsAssetBundle(self.mDesiredSceneName))
         {
             AssetManager.PrepareAssets(self.mDesiredSceneName);
             if (!AssetDownloader.isDone)
             {
                 ProgressWindow.OpenGenericDownloadWindow();
                 AssetDownloader.StartDownload(false, true, ThreadPriority.Normal);
                 this.state = 2;
                 return;
             }
         }
         this.state = 3;
     }
     if (this.state == 2)
     {
         if (!AssetDownloader.isDone)
         {
             return;
         }
         ProgressWindow.Close();
         this.state = 3;
     }
     if (this.state == 3)
     {
         self.mLastSceneName = self.mDesiredSceneName;
         this.req            = AssetManager.LoadSceneAsync(self.mDesiredSceneName, true);
         this.state          = 4;
     }
     if (this.state == 4)
     {
         if (!this.req.canBeActivated || self.mFadingOut || MonoSingleton <GameManager> .Instance.IsImportantJobRunning)
         {
             return;
         }
         if (!string.IsNullOrEmpty(self.UnloadTrigger))
         {
             GlobalEvent.Invoke(self.UnloadTrigger, (object)this);
         }
         SceneAwakeObserver.AddListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake));
         this.req.ActivateScene();
         if (!string.IsNullOrEmpty(self.mLastSceneName))
         {
             AssetManager.UnloadScene(self.mLastSceneName);
         }
         this.state = 5;
     }
     if (this.state == 5)
     {
         if (Object.op_Equality((Object)this.mNewScene, (Object)null) || !this.req.isDone)
         {
             return;
         }
         CriticalSection.Leave(CriticalSections.SceneChange);
         this.state = 6;
     }
     if (this.state == 6)
     {
         if (CriticalSection.IsActive)
         {
             return;
         }
         GC.Collect();
         this.asyncOp = AssetManager.UnloadUnusedAssets();
         this.state   = (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L ? 7 : 101;
     }
     if (this.state == 7)
     {
         if (this.asyncOp != null && !this.asyncOp.get_isDone())
         {
             return;
         }
         FlowNode_GameObject.ActivateOutputLinks((Component)self, 10);
         GameUtility.FadeIn(0.5f);
         self.mDesirdSceneSet = false;
         if (!self.mIgnorePopups && !self.mNewsShown && !GlobalVars.IsTitleStart.Get() && (MonoSingleton <GameManager> .Instance.Player.IsFirstLogin || GameUtility.isLoginInfoDisplay()))
         {
             self.mNewsShown = true;
             GlobalVars.IsTitleStart.Set(true);
             self.mStateMachine.GotoState <HomeWindow.State_LoginBonus>();
         }
         else
         {
             self.NotifyNewFriendRequests();
             if (HomeWindow.EnterHomeCount == 0)
             {
                 self.CheckTrophies();
             }
             if (!self.mNewsShown && !GlobalVars.IsTitleStart.Get() && (MonoSingleton <GameManager> .Instance.Player.IsFirstLogin || self.DebugLoginBonus))
             {
                 self.mNewsShown = true;
                 Json_LoginBonus recentLoginBonus = MonoSingleton <GameManager> .Instance.Player.RecentLoginBonus;
                 if (recentLoginBonus != null)
                 {
                     string iname;
                     int    num;
                     if (recentLoginBonus.coin > 0)
                     {
                         iname = "$COIN";
                         num   = recentLoginBonus.coin;
                     }
                     else
                     {
                         iname = recentLoginBonus.iname;
                         num   = recentLoginBonus.num;
                     }
                     ItemData data = new ItemData();
                     if (data.Setup(0L, iname, num))
                     {
                         NotifyList.PushLoginBonus(data);
                     }
                 }
                 self.NotifySupportResult();
             }
             self.mStateMachine.GotoState <HomeWindow.State_Default>();
         }
         if (self.mDesiredSceneIsHome)
         {
             self.UnlockContents();
             self.FgGIDLoginCheck();
             FlowNode_GameObject.ActivateOutputLinks((Component)self, 15);
         }
         else
         {
             FlowNode_GameObject.ActivateOutputLinks((Component)self, 16);
         }
     }
     if (this.state != 101)
     {
         return;
     }
     DebugUtility.LogWarning("TUTORIAL: HERE");
     FlowNode_GameObject.ActivateOutputLinks((Component)self, 16);
     FlowNode_GameObject.ActivateOutputLinks((Component)self, 10);
     GameUtility.FadeIn(0.5f);
     self.mDesirdSceneSet = false;
     self.mStateMachine.GotoState <HomeWindow.State_Tutorial>();
 }