Search Unity

How to switch Toggles in a ToggleGroup by script?

Discussion in 'UGUI & TextMesh Pro' started by DonaldW, Aug 24, 2014.

  1. DonaldW

    DonaldW

    Joined:
    Apr 27, 2014
    Posts:
    8
    "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!!!

     
  2. DonaldW

    DonaldW

    Joined:
    Apr 27, 2014
    Posts:
    8
    OMG.
    this is my fault. Call myToggle.isOn = true is purely enough and everything is OK.
     
    junochoi likes this.