public void PlaySound(BlockSoundLibrary.BlockSound blockSound, Vector3?position = null) { _audioSource.Stop(); var sound = BlockSoundLibrary.Get().GetSound(blockSound); if (position != null) { AudioSource.PlayClipAtPoint(sound, position.Value, .02f * GameManager.MasterVolume); } else { _audioSource.PlayOneShot(sound, .02f * GameManager.MasterVolume); } }
void Awake() { _instance = this; }