Ejemplo n.º 1
0
 /// <summary>
 /// Stop current song.
 /// </summary>
 /// <param name="inmediateStop">bool - wheter to stop the song inmediately or to fade stop. True by default</param>
 public void StopSong(bool inmediateStart = true)
 {
     if (inmediateStart)
     {
         _audio.PauseAudio();
     }
     else
     {
         StartCoroutine(_audio.FadeOutSongRoutine(.5f));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Play walking sound.
 /// </summary>
 private void PlayWalkingSound()
 {
     if ((GameManager.instance.inGamePlay && !GameManager.instance.isPaused) && _playerInput.grounded && _playerInput.isMoving)
     {
         if (!_audioComponent.audio.isPlaying)
         {
             int surfaceSoundKey = (int)currentSurface;
             _audioComponent.PlaySound(surfaceSoundKey);
         }
     }
     else
     {
         _audioComponent.PauseAudio();
     }
 }