Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

(Bug?) Toggle Group onEnabled Behaviour

Discussion in 'UGUI & TextMesh Pro' started by DantaliaN, Jun 17, 2019.

  1. DantaliaN

    DantaliaN

    Joined:
    Oct 7, 2012
    Posts:
    18
    I need to disable/enable gameObject with ToggleGroup.
    When I make gameObject.SetActive(false) ToggleGroup makes all ActiveToggles.isOn = true. After gameObject.SetActive(true) ToggleGroup check for all toggles and make active the last one.
    And I catch OnValueChanged of all toggles!

    That's really strange behaviour..

    That's b/c you call this.SetToggleGroup((ToggleGroup) null, false) when Toggle.onDisable


    PS
    I use group.allowSwitchOff = disable on Toggle.OnEnable/OnDisable to fix that, but..
     
  2. meikellp

    meikellp

    Joined:
    Apr 6, 2014
    Posts:
    9
    I have the exact same problem. Seems like a bug to me.
     
  3. meikellp

    meikellp

    Joined:
    Apr 6, 2014
    Posts:
    9