Example #1
0
        public void Enter()
        {
            SetStateTo(GameStateType.GS_Continue);

            mTime = 0;

            mNeedUpdate = true;
            mNeedScore  = true;

            //AudioClip clip = Resources.Load(AudioDefine.PATH_UIBGSOUND) as AudioClip;
            //AudioManager.Instance.PlayBgAudio(clip);

            ResourceUnit clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.GetMapBgAudio((MAPTYPE)GameUserModel.Instance.GameMapID), ResourceType.ASSET);
            AudioClip    clip     = clipUnit.Asset as AudioClip;

            AudioManager.Instance.PlayBgAudio(clip);

            AdvancedGuideCtrl.Instance.Exit();


            EventCenter.AddListener <CEvent>(EGameEvent.eGameEvent_Loading, OnEvent);
            EventCenter.AddListener <CEvent>(EGameEvent.eGameEvent_IntoRoom, OnEvent);
            EventCenter.AddListener <CEvent>(EGameEvent.eGameEvent_IntoLobby, OnEvent);
            EventCenter.AddListener(EGameEvent.eGameEvent_ConnectServerFail, OnConnectServerFail);
        }
Example #2
0
 public void EnableVoice(bool enable)
 {
     if (LoopAudioSource.enabled == enable)
     {
         return;
     }
     LoopAudioSource.enabled = enable;
     if (enable)
     {
         ResourceItem audioClipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.GetMapBgAudio((MAPTYPE)GameUserModel.Instance.GameMapID), ResourceType.ASSET);
         AudioClip    clip          = audioClipUnit.Asset as AudioClip;
         AudioManager.Instance.PlayBgAudio(clip);
         LoopAudioSource.Play();
     }
 }
        public void Enter()
        {
            SetStateTo(GameStateType.GS_Continue);

            IGuideMidMatchTip.Instance.RegisterListerner();

            switch (PlayerManager.Instance.LocalAccount.ObType)
            {
            case ObPlayerOrPlayer.PlayerType:
                GamePlayCtrl.Instance.Enter();
                break;

            case ObPlayerOrPlayer.PlayerObType:
                mUIRoot = LoadUiResource.LoadRes(GameMethod.GetUiCamera.transform, GameConstDefine.LoadGameViewer);
                break;
            }

            JxBlGame.Instance.PlayStart();

            CGLCtrl_GameLogic.Instance.AskLoadComplete();

            ResourceUnit clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.GetMapBgAudio((MAPTYPE)GameUserModel.Instance.GameMapID), ResourceType.ASSET);
            AudioClip    clip     = clipUnit.Asset as AudioClip;

            AudioManager.Instance.PlayBgAudio(clip);

            //正常流程
            EventCenter.AddListener <UInt64>(EGameEvent.eGameEvent_GameOver, OnGameOver);

            //新手引导流程
            EventCenter.AddListener <CEvent>(EGameEvent.eGameEvent_Loading, OnEvent);

            EventCenter.AddListener(EGameEvent.eGameEvent_ConnectServerFail, OnConnectServerFail);

            EventCenter.AddListener(EGameEvent.eGameEvent_SdkLogOff, SdkLogOff);

            EventCenter.AddListener(EGameEvent.eGameEvent_ReconnectToBatttle, OnReconnectToBatttle);

            //获取地图信息
            GetMapType();
        }
Example #4
0
        public void Enter()
        {
            SetStateTo(GameStateTypeEnum.Continue);

            mTime = 0;

            mNeedUpdate = true;
            mNeedScore  = true;

            ResourceItem clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.GetMapBgAudio((MAPTYPE)GameUserModel.Instance.GameMapID), ResourceType.ASSET);
            AudioClip    clip     = clipUnit.Asset as AudioClip;

            AudioManager.Instance.PlayBgAudio(clip);

            AdvancedGuideCtrl.Instance.Exit();

            EventCenter.AddListener <FEvent>((Int32)GameEventEnum.Loading, OnEvent);
            EventCenter.AddListener <FEvent>((Int32)GameEventEnum.IntoRoom, OnEvent);
            EventCenter.AddListener <FEvent>((Int32)GameEventEnum.IntoLobby, OnEvent);
            EventCenter.AddListener((Int32)GameEventEnum.ConnectServerFail, OnConnectServerFail);
        }
Example #5
0
        public void Enter()
        {
            SetStateTo(GameStateTypeEnum.Continue);

            IGuideMidMatchTip.Instance.RegisterListerner();

            //LocalAccount是Iplayer类型的
            switch (PlayerManager.Instance.LocalAccount.ObjType)
            {
            case ObPlayerOrPlayer.PlayerType:
                GamePlayCtrl.Instance.Enter();     // 发送消息 ,消息类型GameEventEnum_GamePlayEnter  事件 Show(五大窗口)
                break;

            case ObPlayerOrPlayer.PlayerObType:    // 加载UIviewer
                //mUIRoot = LoadUiResource.LoadRes(GameMethod.GetUiCamera.transform, GameConstDefine.LoadGameViewer);
                break;
            }
            //游戏开始  游戏Bulidings创建
            HolyTechGameBase.Instance.PlayStart();
            //向服务器发送消息   消息类型 LoadComplete
            HolyGameLogic.Instance.AskLoadComplete();

            //音频资源
            ResourceItem clipUnit = ResourcesManager.Instance.loadImmediate(AudioDefine.GetMapBgAudio((MAPTYPE)GameUserModel.Instance.GameMapID), ResourceType.ASSET);
            AudioClip    clip     = clipUnit.Asset as AudioClip;

            AudioManager.Instance.PlayBgAudio(clip);

            //正常流程
            EventCenter.AddListener <UInt64>((Int32)GameEventEnum.GameOver, OnGameOver);//状态转换到GS_Over
            //新手引导流程
            EventCenter.AddListener <FEvent>((Int32)GameEventEnum.Loading, OnEvent);
            EventCenter.AddListener((Int32)GameEventEnum.ConnectServerFail, OnConnectServerFail);
            EventCenter.AddListener((Int32)GameEventEnum.GameEvent_SdkLogOff, SdkLogOff);
            EventCenter.AddListener((Int32)GameEventEnum.ReconnectToBatttle, OnReconnectToBatttle);
            //获取地图信息
            GetMapType();
        }