How to switch Toggles in a ToggleGroup by script?

“Only one member of a group can be active at a time.”

In my mind, Toggles are managed by their ToggleGroup,
the user(developer) just need to call one of these following two:

  • myToggleGroup.NotifyEnabled(myOneToggleOfThisGroup);
  • myToggle.isOn = true;

However, this doesn’t work and my Toggles won’t change by script.

Please help!!!

OMG.
this is my fault. Call myToggle.isOn = true is purely enough and everything is OK.

1 Like