public void OnSceneAwake(GameObject scene) { SceneReplay component = (SceneReplay)scene.GetComponent <SceneReplay>(); if (!Object.op_Inequality((Object)component, (Object)null)) { return; } CriticalSection.Leave(CriticalSections.SceneChange); SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake)); component.StartQuest(this.mQuestParam.iname); }
public void OnSceneAwake(GameObject scene) { SceneBattle component = (SceneBattle)scene.GetComponent <SceneBattle>(); if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { return; } CriticalSection.Leave(CriticalSections.SceneChange); CriticalSection.Leave(CriticalSections.SceneChange); SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake)); component.StartQuest(this.Quest.iname, this.InitData); }
private void OnSceneAwake(GameObject scene) { SceneBattle component = (SceneBattle)scene.GetComponent <SceneBattle>(); if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { return; } CriticalSection.Leave(CriticalSections.SceneChange); CriticalSection.Leave(CriticalSections.SceneChange); SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake)); component.StartQuest(this.mStartingQuest.iname, this.mQuestData); ((Behaviour)this).set_enabled(false); this.ActivateOutputLinks(1); }
public override void OnActivate() { this.Sequence.Scene = (GameObject)null; LightmapSettings.set_lightmapsMode((LightmapsMode)0); if (!string.IsNullOrEmpty(this.SceneID)) { if (this.FadeIn) { GameUtility.FadeOut(0.0f); } SceneAwakeObserver.AddListener(new SceneAwakeObserver.SceneEvent(this.OnSceneLoad)); CriticalSection.Enter(CriticalSections.SceneChange); this.mAsyncOp = AssetManager.LoadSceneAsync(this.SceneID, true); } else { if (!Object.op_Inequality((Object)this.Sequence.Scene, (Object)null)) { return; } this.Sequence.Scene = (GameObject)null; this.ActivateNext(); } }
protected virtual void Awake() { SceneAwakeObserver.Invoke(((Component)this).get_gameObject()); }
private void OnSceneLoad(GameObject sceneRoot) { SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneLoad)); CriticalSection.Leave(CriticalSections.SceneChange); }
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>(); }
private void OnSceneAwake(GameObject scene) { this.mNewScene = scene; SceneAwakeObserver.RemoveListener(new SceneAwakeObserver.SceneEvent(this.OnSceneAwake)); }
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); } }