Hook into the event using EventDelegate:
http://www.tasharen.com/ngui/docs/class_event_delegate.html (http://www.tasharen.com/ngui/docs/class_event_delegate.html)
public class OptionsToMain : MonoBehaviour { public UIToggle soundToggle; void Start() { EventDelegate.Add(soundToggle.onChange, OnSoundToggleChange); } void OnDestroy() { EventDelegate.Remove(soundToggle.onChange, OnSoundToggleChange); } void OnSoundToggleChange() { if (soundToggle.value) { } else { } } }
Hope that helps