public void updated() { GameObject music = GameObject.FindGameObjectWithTag("gameMusic"); bgmVolume bVol = (bgmVolume)music.GetComponent(typeof(bgmVolume)); currVol = volSlider.value; bVol.SetVolume(currVol); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }