public void PlaySound(AudioClip clip, bool loop = false) { AudioUnit audioUnit = AudioUnit.Allocate(); audioUnit.SetAudio(gameObject, clip, loop, m_IsSoundEnable); audioUnit.SetVolume(m_SoundVolume); }
public override void OnSingletonInit() { m_IsSoundEnable = PlayerPrefs.GetInt(SOUND_SAVE_KEY, 1) == 1; m_IsMusicEnable = PlayerPrefs.GetInt(MUSIC_SAVE_KEY, 1) == 1; m_MainUnit = AudioUnit.Allocate(); }