NGUI for Unity
by Charles Bernardoff via PACKT Publishing available here: http://bit.ly/1lp1Do7
I had the opportunity to review the first book on the mega-popular NGUI user interface plug-in for Unity. NGUI is a great UI system for < $100 that you can add into your Unity projects. It is quite in-depth and very powerful so it requires a little ramp up time. The documentation used to be relatively sparse, only a bit on the developer’s website: http://www.tasharen.com/?page_id=140. Thank goodness now there is a full fledged book with tons of tutorials, examples, and explanations. I spent a little bit of time walking through some of the tuts and wanted to share what I found.
First of all, the versions of Unity and NGUI specified for the book and the latest version on the asset store as of Feb. 2014 differ a bit.
My current Unity/NGUI versions:
Unity = 4.3.3f1, NGUI = 3.4.8
Book NGUI version is:
NGUI = 3.0.2 Fortunately/unfortunately, there have been quite a few upgrades to the entire NGUI toolset since the book was written. This is a great sign, meaning NGUI is under active development and continuing to get better. However, the book is out of date in some sections, and when going through the tutorials, occasionally you have to hunt and peck to find the new location of things in the menu because there has been some re-ordering of the menus. For example, the old menus were laid out:
NGUI | Attach | Anchor
but now you will find it in:
Component | NGUI | UI | Anchor
But the Widget Tool suggests you use the new preferred way which is a ‘Control …’ prefab. I tried using these as well as the components that the Widget Tool creates to better understand the system upgrade. This took a lot of extra time but helped me understand the legacy workflow and the new preferred workflow.
Following the tutorials worked well for me. Sometimes it took a little creative manipulation to make them all work but with the solid, explicit instructions and occasionally verifying your scene hierarchy, I got through them.
What this book does best is walk you through step-by-step how to create many different UIs. I have found that this is the best way for me to learn a new tool; actually doing it one step at a time at my own pace, digging in further when I don’t quite understand what is going on. I am a visual learner, so I understand and remember best if I can create these scenes myself, clicking through the Hierarchy, Inspector, and script editors.
NGUI is the UI library of choice right now in Unity. There is a rumored new built-in UI upgrade coming to Unity sometime this year, though they’ve been promising that for literally 3+ years now. The new sole developer for Unity’s GUI is Michael Lyashenko, who wrote NGUI. It looks like NGUI is going to be the new UI system for Unity:
UI development is a valuable, much-needed skill set in the Unity dev ecosystem. Consider investing some time into NGUI!