Exemple #1
0
        /// <summary>打开UI</summary>
        public async void _openUI(params object[] args)
        {
            _args = args;
            showLoading();
            GameObject obj = await GameFrameEntry.GetModule <UIModule>().LoadUI(UIPath, UINode.ToString());

            if (m_isDispose) //UI已经销毁掉了
            {
                GameObject.DestroyImmediate(obj);
                return;
            }

            if (obj == null)
            {
                return;
            }
            openTopUI();
            initGameObject(obj);
            addCanvas();
            closeLoading();
            Refresh();
            //GuideTrigger.OpenUI(this);
            if (OpenAnim == EUIAnim.Customize)
            {
                await OpenAnimCustomize();
            }
            else
            {
                await GameFrameEntry.GetModule <UIModule>().UIAnim(obj, OpenAnim);
            }
            OpenLater();
            MsgDispatcher.SendMessage(GlobalEventType.OpenUI, this);
        }
 /// <summary>
 /// 返回到游戏菜单
 /// </summary>
 public static void BackToGameGameMenu()
 {
     MsgDispatcher.SendMessage(GlobalEventType.ReadyExitGame);
     IsGoGameMenu = true;
     //跳转到过度场景
     UnityEngine.SceneManagement.SceneManager.LoadScene("GameFrameworkLoad");
 }
 private void OnEndCall(int audioGuid)
 {
     m_NowPlayAudio = null;
     MsgDispatcher.SendMessage(GlobalEventType.AudioPlayEnd, audioGuid);
     if (m_WaitPlayAudio != null)
     {
         m_NowPlayAudio = this.m_WaitPlayAudio;
         this.m_NowPlayAudio.Play();
         this.m_WaitPlayAudio = null;
     }
 }
Exemple #4
0
        /// <summary>
        /// 设置音量
        /// </summary>
        /// <param name="voiceType">音效类型</param>
        /// <param name="value"></param>
        public void SetMusicGameVolume(VoiceType voiceType, float value)
        {
            switch (voiceType)
            {
            case VoiceType.Music:
                GlobalData.MusicGameVolume = value;
                break;

            case VoiceType.Sound:
                GlobalData.SoundGameVolume = value;
                break;
            }
            MsgDispatcher.SendMessage(GlobalEventType.GlobalVolumeChange, voiceType, value);
        }
 private void OnEndCall(int audioGuid)
 {
     if (!m_IsStop)
     {
         DequeueAudio();
     }
     MsgDispatcher.SendMessage(GlobalEventType.AudioPlayEnd, audioGuid);
     if (!m_IsStop)
     {
         AudioActionBase nextAction = PeekAudio();
         if (nextAction != null)
         {
             nextAction.Play();
         }
     }
 }
 /// <summary>
 /// 开始某个游戏
 /// </summary>
 public static void StarGame(string AppName, string GameMenuScene = "")
 {
     if (!CheckAppInProject(AppName))
     {
         CLog.Error($"当前工程未包含[{AppName}]游戏");
         return;
     }
     if (!string.IsNullOrEmpty(GameMenuScene))
     {
         GameMenuSceneName = GameMenuScene;
     }
     MsgDispatcher.SendMessage(GlobalEventType.ReadyExitGame);
     IsGoGameMenu           = false;
     GlobalData.MineAppName = AppName;
     //跳转到过度场景
     UnityEngine.SceneManagement.SceneManager.LoadScene("GameFrameworkLoad");
 }
Exemple #7
0
 /// <summary>关闭UI</summary>
 public async void _closeUI()
 {
     CloseBefore();
     if (CloseAnim == EUIAnim.Customize)
     {
         await CloseAnimCustomize();
     }
     else
     {
         await GameFrameEntry.GetModule <UIModule>().UIAnim(gameObject, CloseAnim);
     }
     m_isDispose = true;
     await new WaitForEndOfFrame();
     Dispose();
     GameObject.DestroyImmediate(gameObject);
     await new WaitForEndOfFrame();
     MsgDispatcher.SendMessage(GlobalEventType.CloseUI, this);
 }
Exemple #8
0
 private void OnEndCall(int audioGuid)
 {
     this.RemoveAudio(audioGuid);
     MsgDispatcher.SendMessage(GlobalEventType.AudioPlayEnd, audioGuid);
 }
Exemple #9
0
 private void OnStartCall(int audioGuid, AudioActionBase action)
 {
     this.AddAudio(audioGuid, action);
     MsgDispatcher.SendMessage(GlobalEventType.AudioPlayStart, audioGuid);
 }
Exemple #10
0
 private void ClearAll()
 {
     _instance = new MsgDispatcher();
 }
Exemple #11
0
 internal override void Start()
 {
     MsgDispatcher.AddEventListener(GlobalEventType.GamePause, GamePause);
 }
 private void OnStartCall(int audioGuid)
 {
     MsgDispatcher.SendMessage(GlobalEventType.AudioPlayStart, audioGuid);
 }