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; } } }
new void Awake() { base.Awake(); if( AutoPopulateGUIElements ) GuiElements = GetComponents<GUIElement>(); tex = GetComponent<GUITexture>(); element = tex; sound = FindObjectOfType<SoundToggle>(); }
new void Awake() { base.Awake(); if (AutoPopulateGUIElements) { GuiElements = GetComponents <GUIElement>(); } tex = GetComponent <GUITexture>(); element = tex; sound = FindObjectOfType <SoundToggle>(); }