Ejemplo n.º 1
0
    public void SetupSound()
    {
        float currentVol = originVol;

        if (soundType == SoundType.SFX)
        {
            float pref = PlayerPrefsConstants.GetSFXVolume();
            audioSource.volume = currentVol / 100 * (pref * 100);
        }
        else if (soundType == SoundType.Music)
        {
            float pref = PlayerPrefsConstants.GetMusicVolume();
            audioSource.volume = currentVol / 100 * (pref * 100);
        }
        else if (soundType == SoundType.Announcer)
        {
            float pref = PlayerPrefsConstants.GetAnnouncerVolume();
            audioSource.volume = currentVol / 100 * (pref * 100);
        }
    }
Ejemplo n.º 2
0
 void SetupSettings()
 {
     sfxSlider.value       = PlayerPrefsConstants.GetSFXVolume() * 100;
     musicSlider.value     = PlayerPrefsConstants.GetMusicVolume() * 100;
     announcerSlider.value = PlayerPrefsConstants.GetAnnouncerVolume() * 100;
 }