Author Topic: NGUI 3.0  (Read 36217 times)

N3uRo

  • Guest
NGUI 3.0
« on: September 09, 2013, 10:18:50 AM »
Good job Aren and good move from Unity (I suppose you spoke with them about this)!!

I have the Standard version so I can't try it yet but thanks for letting us get close to NGUI 3.0 ≈ New Unity GUI!!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0
« Reply #1 on: September 09, 2013, 10:31:14 AM »
Well, that's not entirely correct. NGUI 3 is Unity GUI-like, but they are still very different systems and use quite different code under the hood. My goal was to adjust NGUI so that it is more uGUI-like to facilitate a smoother migration process in the future. I basically threw caution to the wind this weekend and decided to go down on it like a fat kid on pie, fixing the most glaring issues with NGUI in the process. It was a long process, and I've attempted it twice before earlier this year, but this time I was successful.

The old UI layouts should upgrade without a hitch, but custom code will need to be updated due to the numerous changes with scale. Here are some tips for upgrading:

* Open each scene in your project, then save them. Make sure to enable all of your game objects, as the upgrade logic only kicks in once the widgets are enabled.
* Drag in your widget-using prefabs into the scene (so they show up), then apply the changes so that the prefabs also get upgraded.
* Globally replace "UICheckbox" with "UIToggle".
* UICheckbox no longer has a 'root', so go through your radio buttons and give them a group ID instead.
* If you've used widget's localScale at any point, change it to use width and height instead.
* UIWidget.localCorners gives you the final 4 vertices of the widget (bottom left, top left, top right, bottom right)
* UIWidget.worldCorners gives you the same vertices, but in world space. There is also UIWidget.innerWorldCorners, in case you need it.
* "Make Pixel Perfect" button is now just called "Correct", beside the widget's dimensions.

I'll modify this post as I think of more things in the future.

N3uRo

  • Guest
Re: NGUI 3.0
« Reply #2 on: September 09, 2013, 10:39:41 AM »
I know that it isn't a copy&paste  ;D

I mean that It's great that we can now use some of the new Unity GUI improvements like widgets size, nested widgets and of course the very requested Z/Depth issues.

dev_xprt

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: NGUI 3.0
« Reply #3 on: September 12, 2013, 12:03:12 AM »
Hi,

Congrats ArenMook!!!. Looking forward to new features and updates. Good Luck :)


Dev

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0
« Reply #4 on: September 12, 2013, 07:39:35 AM »
I put more upgrading tips in the version notes themselves -- http://www.tasharen.com/forum/index.php?topic=11.msg27296#msg27296

I'd be curious to hear from Pro users if they've taken the plunge into 3.0. There have been quite a few improvements to the workflow that should result in a good amount of time saved over the course of the project, but only if they take a few hours to upgrade.

N3uRo

  • Guest
Re: NGUI 3.0
« Reply #5 on: September 12, 2013, 09:57:20 AM »
I put more upgrading tips in the version notes themselves -- http://www.tasharen.com/forum/index.php?topic=11.msg27296#msg27296

I'd be curious to hear from Pro users if they've taken the plunge into 3.0. There have been quite a few improvements to the workflow that should result in a good amount of time saved over the course of the project, but only if they take a few hours to upgrade.

Are you going to release it on the Asset Store soon? I know that you release it first to pro users to do it gradually.

I want to try out please!!  :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0
« Reply #6 on: September 13, 2013, 08:47:46 AM »
Soon™ -- but I will likely include both 2.7 and 3.0 in the same package.

http://www.youtube.com/watch?v=OT0hTxjjkY4&feature=c4-overview&list=UUQGZdUwzE8gmvgjomZSNFJg

:)

N3uRo

  • Guest
Re: NGUI 3.0
« Reply #7 on: September 13, 2013, 11:04:46 AM »
Really nice tutorial for beginners. Good work Aren!

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: NGUI 3.0
« Reply #8 on: September 13, 2013, 04:28:42 PM »
Thanks for the tutorial Aren. I think that the system looks similar to what was shown at Unite for uGUI. The event system seems like a serious step forward and similar to uGUI. I look forward to looking into 3.0 when it is released to the masses. I hope there is still something like ButtonMessage script still where you can register for any message (Hover, Drag, Click, etc.) you want from the UICamera and forward it onto an appropriate receiver.

Also, a minor request in regards to uGUI. I think the way that you were able to look at the high-level UIPanel to analyze your draw calls for your specific UI space and see on which materials the draw call batching is breaking is really helpful. So I'm asking you to include something like a UIPanel material draw call breakdown in uGUI if possible rather than relying on the Unity game window stats window which doesn't list the materials like that.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0
« Reply #9 on: September 13, 2013, 10:16:05 PM »
Unfortunately the detailed breakdown of the draw calls in uGUI is not likely to be there in 1.0 simply because all the batching is done on the C++ side, and as you can probably guess it's a relative black box from the C# side...

That said though, uGUI is more intelligent about how it does batching. Joachim (who wrote the batching logic for it) made sure that it actually checks to see if the widgets actually occlude each other before splitting up the draw call logic. In NGUI's case I simply split it up as soon as I detect a different material. So there are fewer reasons to analyze the uGUI's draw call hierarchy as it should theoretically do the thinking for you.

By the way, one of the reasons I did NGUI 3.0 is because I've been putting off work on NGUI almost entirely for the past ~4-5 months as I was focusing on uGUI, and I was growing quite weary of explaining the same Z vs Depth difference for the upteenth time.

This past weekend I was actually blocked by certain bugs on the uGUI side so I got frustrated and turned back to NGUI. One thing led to another, and I ended up coding like mad for a few days, working out my frustrations by fixing everything I could in NGUI. That's how NGUI 3.0 came to be. I am quite happy with it now... it's basically the system I personally wanted to have all along. uGUI is still better, of course (faster, more efficient, more powerful, and its delegate system is better to boot -- Tim Cooper's work btw) -- but the gap as been narrowed significantly.

But the best part is, NGUI is now much closer to how uGUI works, so going from NGUI 3.0 to uGUI is going to be quite simple -- which was the number one question I got at the last month's Unite conference.

Although, one thing I do find NGUI preferable to uGUI right now are the sexier looking class editors (inspectors). I can't do that in uGUI because it goes against Unity's inspector conventions. With NGUI I have the freedom to do whatever I want, and not be constrained by those silly "conventions". :)

P.S. And yes ButtonMessage and EventListener classes are still there if you want to use them -- though now there are less reasons to do so.

dev_xprt

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: NGUI 3.0
« Reply #10 on: September 14, 2013, 12:12:21 AM »
hi,

Thanks for the tutorial ArenMook. :)

Dev

Bradamante3D

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 79
    • View Profile
Re: NGUI 3.0
« Reply #11 on: September 14, 2013, 06:48:14 AM »
Hi,

you should put that text + a list of changes + some transition instructions in a big welcome post here on the forum. Not a good idea to spread that info among the version thread + this thread that was started by a NGUI user.

There are a lot of NGUI 2.x users out there. Some watched your Unite presentation on YouTube. Some are here on the forums. But a lot of them will be worried about the future of their projects, knowing that Unity will get a new GUI. I am not, because I watched the video and I read things here on the forum.

However, I was a bit suprised to hit the forums today, and see a version 3 going around without much introduction. I watched your intro tutorial on YouTube and had trouble figuring out how my 2.x workflows are affected.
#301224014, #301432336, #302399130

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0
« Reply #12 on: September 14, 2013, 10:01:07 AM »
Version 3 is only available to Pro users right now. When it's out to everyone, there helpful info will be in a separate sticky post. The reason it's in the version notes post right now is because people get email notifications when I post there -- this way it reaches everyone who subscribed to it.

Vonchor

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: NGUI 3.0
« Reply #13 on: September 19, 2013, 02:42:05 PM »
Just idly curious - beginning a new project and I can do other things besides the GUI for a while. So I'm wondering approximately when the 3.0 "standard" version will be released. I'd like to avoid having to migrate if I can avoid it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 3.0
« Reply #14 on: September 19, 2013, 03:27:37 PM »
Approximately this weekend.