public void LoadScene(int sceneId) { DScene db = ReadCfgScene.GetDataById(sceneId); switch (db.SceneType) { case ESceneType.TYPE_LOGIN: { this.NextSceneType = ESceneType.TYPE_LOGIN; } break; case ESceneType.TYPE_ROLE: { this.NextSceneType = ESceneType.TYPE_ROLE; GTDataManager.Instance.LoadCommonData(); } break; case ESceneType.TYPE_CITY: { this.NextSceneType = ESceneType.TYPE_CITY; if (this.CurrSceneType == ESceneType.TYPE_ROLE) { GTCtrl.Instance.AddAllCtrls(); GTDataManager.Instance.LoadRoleData(GTGlobal.CurPlayerID); GTWorld.Instance.EnterGuide(); GTDataTimer.Instance.Init(); } } break; case ESceneType.TYPE_WORLD: { this.NextSceneType = ESceneType.TYPE_WORLD; if (this.CurrSceneType == ESceneType.TYPE_ROLE) { GTDataManager.Instance.LoadRoleData(GTGlobal.CurPlayerID); GTDataTimer.Instance.Init(); GTWorld.Instance.EnterGuide(); } } break; case ESceneType.TYPE_PVE: { this.NextSceneType = ESceneType.TYPE_PVE; } break; } CommandLoadScene cmd = new CommandLoadScene(); cmd.SceneID = sceneId; ChangeState(ESceneType.TYPE_LOAD, cmd); }
public void LoadScene(int sceneId, Callback finishCallback = null) { DCopy db = ReadCfgCopy.GetDataById(sceneId); this.NextCopyType = db.CopyType; CommandLoadScene cmd = new CommandLoadScene(); cmd.SceneID = sceneId; SceneLoading s = (SceneLoading)mStateMachine.GetState(ECopyType.TYPE_LOAD); s.mCallback = finishCallback; ChangeState(ECopyType.TYPE_LOAD, cmd); }
public override void Enter() { base.Enter(); CommandLoadScene ev = Cmd as CommandLoadScene; if (GTWorld.Instance.Bie != null) { GTWorld.Instance.Bie.PauseGuide = true; } GTWindowManager.Instance.Release(); GTWorld.Instance.Release(); GTPoolManager.Instance.Release(); GTWindowManager.Instance.OpenWindow(EWindowID.UILoading); mLoadingSceneId = ev.SceneID; mLoadingWindow = (UILoading)GTWindowManager.Instance.GetWindow(EWindowID.UILoading); mWaitTime = Time.realtimeSinceStartup; }