Exemple #1
0
        public void PlaySound(AudioClip clip, bool loop = false)
        {
            AudioUnit audioUnit = AudioUnit.Allocate();

            audioUnit.SetAudio(gameObject, clip, loop, m_IsSoundEnable);
            audioUnit.SetVolume(m_SoundVolume);
        }
Exemple #2
0
 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();
 }