Ejemplo n.º 1
0
        /// <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);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 通过Audio Key获取Audio文件路径
        /// </summary>
        /// <param name="audioKey"></param>
        /// <returns></returns>
        public static string FetchAudioPathByKey(string audioKey)
        {
            ConfSound audioConf = ConfSound.Get(audioKey);

#if MP3
            return(audioConf != null ? audioConf.SoundPath : string.Empty);
#elif WAV
            return(audioConf != null ? audioConf.WavPath : string.Empty);
#endif
        }
Ejemplo n.º 3
0
        private string GetAudioPath(string sn_)
        {
            if (ConstAudioKeyDict.ContainsKey(sn_))
            {
                return(ConstAudioKeyDict[sn_]);
            }

            ConfSound s = ConfSound.Get(sn_);

#if MP3
            return(null != s ? s.SoundPath : null);
#elif WAV
            return(null != s ? s.WavPath : null);
#endif
        }
Ejemplo n.º 4
0
        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);
        }