Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How do you change Toggle value without triggering Toggle Transition?

Discussion in 'UGUI & TextMesh Pro' started by Deleted User, Jun 10, 2021.

  1. Deleted User

    Deleted User

    Guest

    I've got a script that needs to change the value of toggle without triggering the toggle transition. I can't outright disable toggle transitions, I only want them disabled for this one change but enabled for when the user makes changes. I also need to use SetIsOnWithoutNotify() instead of Toggle.isOn if possible. I tried this:
    Code (CSharp):
    1. toggle.toggleTransition = Toggle.ToggleTransition.None;
    2. toggle.SetIsOnWithoutNotify(true);
    3. toggle.toggleTransition = Toggle.ToggleTransition.Fade;
    The toggle doesn't seem to update fast enough, as the animation still plays. Is there a way around this?
     
    Last edited by a moderator: Jun 11, 2021
  2. Deleted User

    Deleted User

    Guest

    I adjusted my question slightly to make it more clear. Does anyone know a way around this? Any help would be very much appreciated :)