private void PlayTutorial() { GameManager instance = MonoSingleton <GameManager> .Instance; string nextTutorialStep = instance.GetNextTutorialStep(); if (string.IsNullOrEmpty(nextTutorialStep)) { this.CompleteTutorial(); } else { if (BackgroundDownloader.Instance.IsEnabled) { ProgressWindow.Close(); } if (instance.FindQuest(nextTutorialStep) == null) { if (nextTutorialStep.Contains("_SG")) { string sceneName = nextTutorialStep.Split(new string[1] { "_SG" }, StringSplitOptions.None)[0]; Debug.LogWarning((object)("SG Tutorial: " + nextTutorialStep + ", going to scene: " + sceneName)); instance.CompleteTutorialStep(); this.StartCoroutine(this.LoadSceneAsync(sceneName)); } else { this.StartCoroutine(this.LoadSceneAsync(nextTutorialStep)); } } else { GlobalVars.SelectedQuestID = nextTutorialStep; GlobalVars.SelectedFriendID = string.Empty; this.ActivateOutputLinks(2); } } }
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>(); }
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 (self.mDesiredSceneIsHome) { foreach (string resourcePath in FlowNode_PlayBGM.GetHomeBGM()) { AssetManager.PrepareAssets(resourcePath); } } 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) { if (self.mDesiredSceneIsHome) { FlowNode_PlayBGM.PlayHomeBGM(); } 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 (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mNewScene, (UnityEngine.Object)null) || !this.req.isDone) { return; } CriticalSection.Leave(CriticalSections.SceneChange); this.state = 6; } if (this.state == 6) { if (CriticalSection.IsActive) { return; } this.asyncOp = AssetManager.UnloadUnusedAssets(); this.state = 7; } if (this.state != 7 || 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 if (!self.mIgnorePopups && !GlobalVars.IsTitleStart.Get() && !self.mBeginnerShown) { self.mBeginnerShown = true; self.mStateMachine.GotoState <HomeWindow.State_BeginnerNotify>(); } else { self.MiscBeforeDefaultState(); 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); } }