[Unity3d beta 4.6] Make Active for UnityEngine.UI.Toggle

I am playing around with the 4.6beta and UnityEngine.UI. I have a ToggleGroup setup and I want to select a toggle in code after I load some PlayerPrefs for which toggle was selected last time.

I found the toggle that I want to activate, but I do not know how to make it active. I looked through the scripting reference for Toggle and ToggleGroup but I do not see any call that accomplishes this. I thought that UnityEngine.UI.ToggleGroup.NotifyEnabled(Toggle t) would do it, but that did not work.

It is possible that sending a ToggleEvent is required… but I do not quite understand the eventing system in Unity enough to evaluate that option.

Does anyone know how to tell a toggle to become active in code?

NotifyEnabled seems to only be used to inform the group that the Toggle is enabled.

So if you want to actually change a state of a single Toggle you just change it’s isOn value:

toggle.isOn = true;

I found the answer to my own question just a moment ago. I needed to set the Toggle.isOn property to true. The name confused me. I bypassed the property due to assuming that it was a function that returned a bool; like EventSystems.UIBehaviour.IsActive or UI.Selectable.IsInteractable.

At this time the documentation for the Toggle.isOn call is:

Is the toggle on.

This sounds like a method that returns a bool, but then it is clearly referenced as an actual bool property when you click into it. Maybe a better label could be used to identify it as an actual value. Like ‘selected’ which would be like the enabled property on many Unity objects.

After looking for instances of properties and methods starting with ‘is’, there appears to be no standard usage of the word ‘is’ in naming. The word ‘on’ for example has the standard usage of being a method that reacts to an event.