Exemplo n.º 1
0
        public void SetPlaybackState(AudioPlaybackState state)
        {
            if (state == _audioPlaybackState)
            {
                return;
            }

            switch (state)
            {
            case AudioPlaybackState.Stop:
            {
                Stop();
            }
            break;

            case AudioPlaybackState.Paused:
            {
                Pause();
            }
            break;

            case AudioPlaybackState.Playing:
            {
                Play();
            }
            break;
            }

            _audioPlaybackState = state;
        }
Exemplo n.º 2
0
 void UpdateMat(AudioPlaybackState state)
 {
     if (m_showingState != state)
     {
         m_renderer.material = state == AudioPlaybackState.eStopped ? matStart : matStop;
         m_showingState      = state;
     }
 }
Exemplo n.º 3
0
        void SetPlaybackState(AudioPlaybackState state)
        {
            UnityEngine.Assertions.Assert.IsTrue(IsReady());

            SetStreamState(state, m_state);
            m_state = state;
            m_events.playbackChangeEvent.Invoke(m_state);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Update the internal streaming according to playback state.
        /// </summary>
        /// <param name="updated"></param>
        /// <param name="previous"></param>
        void SetStreamState(AudioPlaybackState updated, AudioPlaybackState previous)
        {
            switch (updated)
            {
            case AudioPlaybackState.ePaused:
                m_source.Pause();
                break;

            case AudioPlaybackState.ePlaying:
                if (previous == AudioPlaybackState.eStopped)
                {
                    m_source.Play();
                }
                else
                {
                    m_source.UnPause();
                }
                break;

            case AudioPlaybackState.eStopped:
                m_source.Stop();
                break;
            }
        }
Exemplo n.º 5
0
 void UpdateMat(AudioPlaybackState state)
 {
     m_renderer.material = state == AudioPlaybackState.ePaused ? matResume : matPause;
 }