Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Shifty Geezer on July 04, 2015, 01:00:17 PM
-
I have a toggle that sets a value for my camera type. It uses the UIToggle's 'OnValueChange' delegate. The problem is this is called when the level starts as values are disabled/enabled, I guess. The same happens with tweens getting callbacks at start.
Is there a way to not call the delegate on initialisation somehow? Or is there a correct approach to deal with this problem?
-
Set the delegate in Start() in a script set to execute after everything else.
-
Thanks. For reference, instead of adding UI_Control/SavePrefs in the object's Inspector, I use:
Start(){
optionsTweenAlpha.AddOnFinished(SavePrefs);
}