Exemplo n.º 1
0
 /// <summary>
 /// Stops previous audio, and plays this one
 /// </summary>
 /// <param name="soundName">Name of sound file</param>
 public void PlayAudioStopPrev(SFXCollection sfx)
 {
     AudioPlayerFullStop();
     _myAudioSource.PlayOneShot(SearchResource(sfx));
 }
Exemplo n.º 2
0
 private void Awake()
 {
     sfxCollection = FindObjectOfType <SFXCollection>();
     soundManager  = FindObjectOfType <SoundManager>();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Play One Shot of the SFX
 /// </summary>
 /// <param name="soundName">Name of sound file</param>
 public void PlaySoundEffect(SFXCollection sfx)
 {
     _myAudioSource.PlayOneShot(SearchResource(sfx));
 }
Exemplo n.º 4
0
 string audioToString(SFXCollection s)
 {
     return(s.ToString().ToLower());
 }
Exemplo n.º 5
0
    private AudioClip SearchResource(SFXCollection sfx)
    {
        string location = "Audio/" + _resourceLocation + "/" + audioToString(sfx);

        return(Resources.Load <AudioClip>(location));
    }
Exemplo n.º 6
0
 ///// <summary>
 ///// Adds an item to the Playlist
 ///// </summary>
 ///// <param name="vOs"></param>
 public void AddPlaylistQueue(SFXCollection sfx)
 {
     StopAllCoroutines();
     _sfxCollection.Add(sfx);
 }
Exemplo n.º 7
0
 private void Start()
 {
     soundManager  = FindObjectOfType <SoundManager>();
     sfxCollection = FindObjectOfType <SFXCollection>();
     // volumeManager = FindObjectOfType<VolumeManager>();
 }