Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Asixjin on June 03, 2014, 12:01:44 PM
-
I have a few question that I've been searching days for the answers to. I guess I'll just list my questions instead of asking what exactly need done so it'd be easy to answer.
1.How can I pause my code to wait for input from a NGUI button (ie The game needs input and won't continue till a button is pressed)?
2.Is it possible to make buttons disappear when they aren't needed (I see Dialogue System can do this but I'm not sure how)?
3.I know the text on a button can be changed (by changing the label text), but can I change the action performed "On Click" as needed?
I hope I was clear in what I need answered and I appreciate any help. If it matters I am using this information for a turned based battle system I am working on and I've hit these walls. I've been using Unity and C# for about 2-3 months but I'm quick to understand certain concepts.
-
1. Pausing a game can be done via Time.timeScale = 0, and is not in any way related to NGUI. If you are asking how you can prevent input from falling through to your game, create a UIWidget covering the screen and give it a collider. There is no equivalent of Console.ReadLine, if that's what you're asking for.
2. All widgets in NGUI have alpha, and it's cumulative. Meaning if you have a UIWidget on your button and this button has a label underneath, changign the button's alpha to 0 will also hide the label.
3. EventDelegate.Set(button.onClick, SomeNewFunction);