Пример #1
0
    void Start()
    {
        slider = GetComponent <Slider>();

        MainMusic = GameObject.Find("MainMusic");
        mainSound = MainMusic.GetComponent <MainSound>();

        slider.value = PlayerPrefs.GetInt("BGM");
    }
Пример #2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         if (this != instance)
         {
             Destroy(this.gameObject);
         }
     }
 }