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(); }
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(); }
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(); }
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(); } }