/// <summary> /// 进入场景结果 /// </summary> /// <param name="msgresponse"></param> private void OnEnterSceneResponse(object msgResponse) { SCSceneEnterResponse msg = msgResponse as SCSceneEnterResponse; if (!MsgStatusCodeUtil.OnError(msg.ResponseStatus)) { int gameMode = (this.m_sceneData.playMode / 10000) % 10; if (this.m_currentScene != null) { this.m_currentScene.DestroyScene(); } LoadingProgressManager.Instance.LoadProgressScene(); BigWorldManager.Instance.ClearBigWorld(); //预加载音频 #if MP3 EngineCoreEvents.ResourceEvent.PreloadAssetEvent.SafeInvoke(ConfSound.Get("Game_01").SoundPath, null); #elif WAV //EngineCoreEvents.ResourceEvent.PreloadAssetEvent.SafeInvoke(ConfSound.Get("Game_01").WavPath, null); #endif GameEvents.System_Events.PlayMainBGM(false); this.m_currentScene = SceneFactory.Instance.CreateScene((SceneMode)gameMode, (int)this.m_sceneData.id); (this.m_currentScene as GameSceneBase).InitScene(this.m_sceneData, (IList <long>)msg.SceneExhibits, (IList <long>)msg.TaskExhibits, (IList <long>)msg.OfficerIds, msg.Seconds); if (msg.IsDropScene) { (this.m_currentScene as GameSceneBase).InitRandomOutput(msg.TaskExhibits.Count, msg.DropItems); } } }
public void EnterExhibitionHallScene() { if (this.m_currentScene != null) { this.m_currentScene.DestroyScene(); } LoadingProgressManager.Instance.LoadProgressTalkScene(); BigWorldManager.Instance.ClearBigWorld(); this.m_currentScene = SceneFactory.Instance.CreateScene(SceneMode.EXHITITIONHALL) as ExhititionHallScene; (this.m_currentScene as ExhititionHallScene).InitScene(); }
private void OnEnterTalkScene(string sceneName) { if (this.m_currentScene != null) { this.m_currentScene.DestroyScene(); } LoadingProgressManager.Instance.LoadProgressTalkScene(); BigWorldManager.Instance.ClearBigWorld(); this.m_currentScene = SceneFactory.Instance.CreateScene(SceneMode.NORMALTALK) as NormalTalkScene; (this.m_currentScene as NormalTalkScene).InitScene(sceneName); }
private void OnPrepareScene() { int gameMode = (this.m_sceneData.playMode / 10000) % 10; if (this.m_currentScene != null) { this.m_currentScene.DestroyScene(); } LoadingProgressManager.Instance.LoadProgressScene(); BigWorldManager.Instance.ClearBigWorld(); //预加载音频 #if MP3 EngineCoreEvents.ResourceEvent.PreloadAssetEvent.SafeInvoke(ConfSound.Get("Game_01").SoundPath, null); #elif WAV //EngineCoreEvents.ResourceEvent.PreloadAssetEvent.SafeInvoke(ConfSound.Get("Game_01").WavPath, null); #endif GameEvents.System_Events.PlayMainBGM(false); this.m_currentScene = SceneFactory.Instance.CreateScene((SceneMode)gameMode, (int)this.m_sceneData.id); }
/// <summary> /// 创建指定类型的Scene /// </summary> /// <param name="sceneMode"></param> public SceneBase CreateScene(SceneMode sceneMode, int sceneId = -1) { Type targetSceneType = null; if (this.m_sceneDict.TryGetValue(sceneMode, out targetSceneType)) { SceneBase scene = null; if (sceneId != -1) { scene = Activator.CreateInstance(targetSceneType, sceneId) as SceneBase; } else { scene = Activator.CreateInstance(targetSceneType) as SceneBase; } return(scene); } return(null); }
public void CreateScene(SceneMode sceneMode, int sceneId = -1) { this.m_currentScene = SceneFactory.Instance.CreateScene(SceneMode.NORMALSCENE); }