1
NGUI 3 Support / Getting access to multiple scripts from a button
« on: June 27, 2015, 11:43:26 AM »
Hi guys,
Whilst I've been 'using' NGUI for a year now my developer has done most of the actual NGUI setup so I've never really had to dive in and learn it myself. It's getting to the point now whereby I need to be able to iterate faster and I really ought to start understanding things myself. I've watched the getting started tutorials, but I'm slightly stumped by a few things.
Initially I was setting up NGUI for each & every scene in my project. My developer pointed out this is idiotic and now we have a single 'UI' scene. This scene then references and loads the other scenes in the project within it. It looks as though my dev wrote a custom script to do this UI Manager
2 current issues:
1) I'm not sure how to disable and enable certain NGUI elements on a per-scene basis. For instance in scene A I would like a 'Play' button to show, but for this same button to be hidden in Scene B. Can anyone point me to some relevant documentation for this?
2) I've added a new script to my game that causes lots of objects to burst apart when a input is pressed (you define the input in the Editor). In my case I have set this input on the object to be Spacebar.
How can I Notify this script via the NGUI play button? I created a prefab of the object in the scene where the exploding script is and dragged that to the On Notify field, however none of the dropdowns actually make the script work like they do in the actual scene itself.

Do I need to modify this exploding script (I tried making the key a public rather than private variable, but this didnt change the dropdown), or is there something I need to do to NGUI?
Thanks for any advice,
T
Whilst I've been 'using' NGUI for a year now my developer has done most of the actual NGUI setup so I've never really had to dive in and learn it myself. It's getting to the point now whereby I need to be able to iterate faster and I really ought to start understanding things myself. I've watched the getting started tutorials, but I'm slightly stumped by a few things.
Initially I was setting up NGUI for each & every scene in my project. My developer pointed out this is idiotic and now we have a single 'UI' scene. This scene then references and loads the other scenes in the project within it. It looks as though my dev wrote a custom script to do this UI Manager
2 current issues:
1) I'm not sure how to disable and enable certain NGUI elements on a per-scene basis. For instance in scene A I would like a 'Play' button to show, but for this same button to be hidden in Scene B. Can anyone point me to some relevant documentation for this?
2) I've added a new script to my game that causes lots of objects to burst apart when a input is pressed (you define the input in the Editor). In my case I have set this input on the object to be Spacebar.
How can I Notify this script via the NGUI play button? I created a prefab of the object in the scene where the exploding script is and dragged that to the On Notify field, however none of the dropdowns actually make the script work like they do in the actual scene itself.

Do I need to modify this exploding script (I tried making the key a public rather than private variable, but this didnt change the dropdown), or is there something I need to do to NGUI?
Thanks for any advice,
T

