예제 #1
0
        public static void OpenMovieEx()
        {
            string pausedMusic = FusionAudio.StopMusic();

            LTStoryController.OpenMovie(() =>
            {
                if (LTCombatEventReceiver.Instance != null)
                {
                    LTCombatEventReceiver.Instance.StoryOver(pausedMusic);
                }
            }, "LTPrologueVideo");
        }
예제 #2
0
        private void StartRecord()
        {
            moveFingerObj.CustomSetActive(true);
            releaseFingerObj.CustomSetActive(false);

            if (audioRecord != null)
            {
                EB.Debug.LogWarning("StartRecord: recording ...");
                return;
            }

            if (Microphone.devices.Length <= 0)
            {
                EB.Debug.LogWarning("StartRecord: their is no microphone devices");
                return;
            }

            microphoneDevice = Microphone.devices[0];
            if (string.IsNullOrEmpty(microphoneDevice))
            {
                EB.Debug.LogWarning("StartRecord: invalid microphone device");
                return;
            }

            if (audioPlay != null)
            {
                audioPlay.Stop();
                audioPlay = null;
            }
            else
            {
                pausedMusic = FusionAudio.StopMusic();
            }

            audioRecord = Microphone.Start(microphoneDevice, false, Mathf.FloorToInt(AudioWraper.MAXLENGTH),
                                           AudioWraper.FREQUENCY);
            if (audioRecord == null)
            {
                int minFreq = 0, maxFreq = 0;
                Microphone.GetDeviceCaps(microphoneDevice, out minFreq, out maxFreq);

                EB.Debug.LogWarning(
                    "StartRecord: Microphone.Start with device {0} minFreq = {1} maxFreq = {2} audioFreq = {3} maxLength = {4} failed",
                    microphoneDevice, minFreq, maxFreq, AudioWraper.FREQUENCY, AudioWraper.MAXLENGTH);

                FusionAudio.ResumeMusic(pausedMusic);
                pausedMusic      = string.Empty;
                microphoneDevice = string.Empty;

                LTChatManager.Instance.AskMicrophone();
            }
        }
예제 #3
0
    /// <summary>
    /// 显示loading界面
    /// </summary>
    /// <param name="onReady">回调</param>
    /// <param name="showSplash">显示loading的Label</param>
    /// <param name="showDownloading">显示下载的Label</param>
    /// <param name="showBlock">显示蒙版,防止点击</param>
    /// <param name="showUpdateAsk">显示下载请求</param>
    /// <param name="showCloud">显示云</param>
    public void ShowLoadingScreen(System.Action onReady, bool showSplash = true, bool showBlock = false, bool showCloud = false)
    {
        _ShowLoadingScreen_CounterOnce++;

        if (IsLoadingScreenUp)
        {
            EB.Debug.Log("loading界面正在显示,新的回调立即执行!");
            onReady?.Invoke();
            return;
        }

        EB.Debug.Log("loading界面开始=====>");
        FusionAudio.StopMusic();
        FusionAudio.StopAmbience();

        if (null == UIHierarchyHelper.Instance)
        {
            EB.Debug.LogWarning("ShowLoadingScreen: UIHierarchyHelper is null");
            return;
        }

        if (!UIHierarchyHelper.Instance.gameObject.activeSelf)
        {
            EB.Debug.LogWarning("ShowLoadingScreen: UIHierarchyHelper is disabled");
            return;
        }

        ClearEnstackQueue();

        IsLoadingScreenUp = true;
        RemoveTimer();

        if (_loadingScreen == null)
        {
            UIHierarchyHelper.Instance.LoadAndPlaceAsync(go =>
            {
                _loadingScreen       = go;
                _loadingScreen_logic = go.GetComponent <LoadingLogic>();
                ShowLoadingScreen_AfterFunc(showSplash, showBlock, showCloud, onReady);
            }, loadingScreenPrefabPath, UIHierarchyHelper.eUIType.None, null, true);
        }
        else
        {
            ShowLoadingScreen_AfterFunc(showSplash, showBlock, showCloud, onReady);
        }
    }
예제 #4
0
        public override void End()
        {
            SparxHub.Instance.PushManager.OnScheduleLocalNotification -= ScheduleLocalNotification;
            SparxHub.Instance.ChatManager.OnConnected -= RegisterChatChannels;

            DestroyFlowControlObject();

            HudLoadManager.DestroyAllHud();
            SceneLoadManager.DestroyAllLevel();
            PlayerManagerForFilter.Dispose();
            NpcManager.Dispose();
            MainLandLogic.Dispose();
            CombatLogic.Dispose();
            InputBlockerManager.Instance.ForceUnlockAll();
            LoadingSpinner.Destroy();
            FusionAudio.StopMusic();
            FusionAudio.StopAmbience();
            ChatController.instance.Clean();
        }
예제 #5
0
        public void PlayAudio(AudioClip clip)
        {
            if (audioRecord != null)
            {
                EB.Debug.Log("PlayAudio: recording ...");
                return;
            }

            if (audioPlay != null)
            {
                audioPlay.Stop();
                audioPlay = null;
            }
            else
            {
                pausedMusic = FusionAudio.StopMusic();
            }

            audioPlay = NGUITools.PlaySound(clip);
        }