Example #1
0
        public void PlaySoundGlobal(Sounds clip)
        {
            Transform   sound = PoolManager.SpawnWithClip(audioDad, audioListener.transform.position, Quaternion.identity, clips[(int)clip], audioListener.transform);
            AudioSource temp  = sound.GetComponent <AudioSource>();

            temp.Play();
        }
Example #2
0
        public void PlaySoundAt(Vector3 pos, Sounds clip)
        {
            Transform   sound = PoolManager.SpawnWithClip(audioDad, pos, Quaternion.identity, clips[(int)clip]);
            AudioSource temp  = sound.GetComponent <AudioSource>();

            temp.Play();
        }
Example #3
0
        public void PlaySoundGlobal(AudioClip clip, float volume = 1f)
        {
            Transform   sound = PoolManager.SpawnWithClip(audioDad, audioListener.transform.position, Quaternion.identity, clip, audioListener.transform);
            AudioSource temp  = sound.GetComponent <AudioSource>();

            temp.volume = volume;
            temp.Play();
        }
Example #4
0
 public void PlayMusic(Sounds clip)
 {
     if (jukebox == null)
     {
         jukebox = PoolManager.SpawnWithClip(audioDad, audioListener.transform.position, Quaternion.identity, clips[(int)clip], audioListener.transform).GetComponent <AudioSource>();
         jukebox.gameObject.name = "jukebox";
         jukebox.loop            = true;
         jukebox.Play();
     }
     else
     {
         jukebox.clip = clips[(int)clip];
         jukebox.Play();
     }
 }