Radio buttons

Discussion in 'UnityGUI' started by ITAmember, Jun 4, 2010.

  1. ITAmember

    ITAmember

    New Member

    Joined:
    Feb 13, 2010
    Messages:
    88
    I would like to make a radio button control out of multiple toggle controls. However, since each of the toggle controls are independent of each other you can select multiple ones, I only want the user to be able to select one at a time.

    I know I can do this with brute force in scripting by storing the last state of the toggle, testing for change, and setting all the others to false, but there should be a better way.

    If my description of a radio button is confusing here is a wikipedia link. http://en.wikipedia.org/wiki/Radio_button
  2. unitymatrix

    unitymatrix

    Member

    Joined:
    Dec 29, 2009
    Messages:
    94
  3. ITAmember

    ITAmember

    New Member

    Joined:
    Feb 13, 2010
    Messages:
    88
    Thank you, works great!
  4. mythicwave

    mythicwave

    New Member

    Joined:
    Jul 13, 2008
    Messages:
    144
  5. mythicwave

    mythicwave

    New Member

    Joined:
    Jul 13, 2008
    Messages:
    144
    Actually, I got it without SelectionGrid. The code isn't that tricky :roll:
  6. raiden

    raiden

    Member

    Joined:
    Feb 8, 2009
    Messages:
    197
    I can't believe i fiddled farted with this for hours, when "unitymatrix" had the perfect solution!

    Thanks!

    -Raiden
  7. Cesarecf

    Cesarecf

    New Member

    Joined:
    Sep 1, 2012
    Messages:
    3