Beispiel #1
0
 void Awake()
 {
     if (gv != null)
     {
         Destroy(gameObject);
         return;
     }
     DontDestroyOnLoad(gameObject);
     gv = this;
 }
Beispiel #2
0
    private void Start()
    {
        gv           = FindObjectOfType <GameVolume>();
        musicVolume  = gv.MusicVolume;
        soundsVolume = gv.SFXVolume;
        if (value == "Music")
        {
            slider.value = musicVolume / 100f;
        }
        else
        {
            slider.value = soundsVolume / 100f;
        }

        AkSoundEngine.SetRTPCValue("music_option", musicVolume);
        AkSoundEngine.SetRTPCValue("sfx_option", soundsVolume);
    }