void Start() { slider = GetComponent <Slider>(); MainMusic = GameObject.Find("MainMusic"); mainSound = MainMusic.GetComponent <MainSound>(); slider.value = PlayerPrefs.GetInt("BGM"); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this); } else { if (this != instance) { Destroy(this.gameObject); } } }