void Awake()
    {
        DontDestroyOnLoad(transform.gameObject);

        foreach (var item in FindObjectsOfType <SoundSliderScript>())
        {
            if (item.transform.parent.name == "Music")
            {
                MusicSlider = item;
            }
            if (item.transform.parent.name == "Sound")
            {
                SoundSlider = item;
            }
        }

        foreach (var item in FindObjectsOfType <SoundToggle>())
        {
            if (item.transform.parent.name == "Music")
            {
                MusicToggle = item;
            }
            if (item.transform.parent.name == "Sound")
            {
                SoundToggle = item;
            }
        }
    }
Exemple #2
0
 new void Awake()
 {
     base.Awake();
     if( AutoPopulateGUIElements ) GuiElements = GetComponents<GUIElement>();
     tex = GetComponent<GUITexture>();
     element = tex;
     sound = FindObjectOfType<SoundToggle>();
 }
Exemple #3
0
 new void Awake()
 {
     base.Awake();
     if (AutoPopulateGUIElements)
     {
         GuiElements = GetComponents <GUIElement>();
     }
     tex     = GetComponent <GUITexture>();
     element = tex;
     sound   = FindObjectOfType <SoundToggle>();
 }