unity3d - NGUI UIToggle how to toggle / deactivate one -


itemprop = "text">

I have two UIToggle objects, so when I click on, for example, toggle 1 is automatically enabled and Toggle 2 is disabled but I'm trying to turn them on in script

I like UIToggle 1:.

  UIToggle toggleOn = ToogleParen.transform.FindChild ("ButtonOn"). GetComponent & LT; UIToggle & gt; ();   

And activate it by doing so:

  toggleOn.value = true;   

The problem occurs when I try to disable it:

  toggleOn.value = false; & Lt; --- Nothing, the toggle button is not inactive !! Do anyone know how to toggle the two UITogal objects program?  

Thank you!

You have to refresh the control so that NGi can redress it on the screen. After adding some things, you have to do the grid.

Bonus: As you have said, I think that you have a radio button (only one selection is possible at a time). If yes, then you should use the checkbox UICheckbox to use as a radio button, as ngùi offers features and I will not have to uncheck this case you other check boxes in the code.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -