Best UI these days

Been a while since Ive done much with UI.

Started with NGUI since it was always the better choice. Been playing with Unitys integrated one, but wondering what peoples thoughts on the current best is. Better to stick with NGUI or use the new one.

Im thinking NGUI might still be the better choice.

NGUI is still the better choice. I only use the integrated one because I’m cheap

2 Likes

Last time I saw this question asked, the answer that swayed me the most was something along the lines of “Go with UnityUI since it’s guaranteed to get continued support and work with all Unity updates.” Going off that advice I wend with UnityUI and while I’m sure it could be a “grass is always greener” kind of situation, I’m not really happy that I did.

UnityUI can do some powerful things and has some cool ways you can integrate it, but there’s still a lot of issues with performance. Disabling UI objects using gameObject.SetActive(false) can cause serious performance spikes. Using the PixelPerfect option also causes heavy performance hits. There are dozens of other issues littered in there, but it’s clear there’s still a lot of optimization that needs to be done for Unity’s integrated UI.

NGUI, on the other hand has been out for a while and has a lot of support to go with it as well. I’ve heard this is the best option in pretty much every case. I only got the chance to use NGUI for a little bit but it has a lot of tutorials to get you started and a very well documented code reference section.

That’s just what I would do based on my experience using UnityUI. For more of a reference point, I’ve used UnityUI to:

  • draw hud elements
  • dialogue tree display
  • multi-cell inventory
  • journal handling
  • map display
  • game settings
  • controls
  • in-game health bars

Aside from performance, the biggest pain I’ve had is in positioning elements. There’s no integrated method to get a control’s position in Canvas space (if you’re using Canvas Camera or World Space) so you end up having to get the control’s world position and do a bunch of conversions from there.

Sorry for the wall of text. Hope that helps some.

3 Likes

I vote unity UI mainly because I’m a cheap skate, guaranteed better support and no issues with world space.

2 Likes

Although I prefer NGUI, the biggest problem will be ongoing support. The author has already stated there won’t be new features and I’m not sure how much longer it will be maintained, so if you run into a weird issue on a certain platform, you’ll need to end up fixing it yourself (at least you have the source code)

With Unity UI you won’t have this issue, and it will get fixed eventually.

But yeah, for now NGUI is pretty solid, and will be the UI I use now and in the near future, until I run into some massive breaking issue that can’t be fixed.

Perhaps NGUI will open-source it on GitHub when support ends, and people will be able to make pull requests for various fixes as they appear?

That would be nice.

1 Like

Ill probably look at going back to NGUI. I saw it got an update just the other day, so its obviously still getting supported quite well. Cant decide if no new features is a big deal or not! I’ve never really dug too deep into NGUI to see if there are any features missing I need. I do recall it being easier for doing 3D type UIs, especially HUD stuff, which is what I’m mainly interested in atm. Currently trying to do a new HUD for Inferno so I can load it up for greenlighting. Been spending a bunch of time on it lately getting it ready.

Cheers for the thoughts.

1 Like

Unity UI with Text Mesh Pro so your text doesn’t look horrible. As I understand it, the “new” (4.3 or something) Unity UI was about 75% of NGUI (I gather they hired the dude)… I have a very GUI-heavy game and while I find the endlessly-nested thing a bit painful (it reminds me of the horrible ancient Java Swing UI) it does work and as others have noted, it’s free. There’s a lot of bang for the buck there at the free price point.

I didn’t see much in NGUI that made the case for spending more money, basically.

If I were you, I would stick to Unity’s UI until I actually ran into some of the problems you’ve heard of. I’ve made jet fighter and space HUDs, with 3D radar and visor tracking simultaneously, and I can track hundreds of objects before the lag becomes problematic. The only real problem I have is mask alias, it looks like crap, but I haven’t looked for a solution yet.

Native UI is very practical.

Nope. He worked at Unity briefly, but the UI system they ended up with is 100% by Unity and 0% NGUI.

–Eric

I already own NGUI, so the save money argument isnt too relevant to me. There was at least one thing that already irritated me about Unity UI. The buttons handler doesnt support arguments, which means I have to write a handler for every single button that is specific to that button. This is silly. I could easily use the same function and pass an enum/int parameter and save unnecessary code.

Wait. What do you mean the button handler doesn’t? Is this not what you’re referring to?

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class Foo : MonoBehaviour {
    public void onButtonClick(int x) {
        Debug.Log(x);
    }
}

2743699--197794--see.png

4 Likes

I’ve used unity UI happily since it first came out, and rarely if ever have I ran into problems. I also do use a lot of disabling and enabling of whole canvases, single images and buttons and joysticks and whatnot… never seemed to be too much of a performance issue on android…

Perhaps I am ignorant though. I have never used NGUI.

1 Like

It’s true, you can use that to call your code’s functions on clicks. I think it only allows for passing a single parameter though, am I wrong on that?

Additionally, there is a group of devs working on extensions to UnityUI controls that you can pop in. [Here]

Like I said, it really is a powerful tool if you’ve got the patience to write some editor extensions to make it fit with your workflow.

Attempting to add more arguments doesn’t seem to work but the docs read as if there should be support for more arguments with the class ButtonClickedEvent inherits from.

https://docs.unity3d.com/ScriptReference/UI.Button.ButtonClickedEvent.html
https://docs.unity3d.com/ScriptReference/Events.UnityEvent.html
https://docs.unity3d.com/ScriptReference/Events.UnityEvent_1.html
https://docs.unity3d.com/ScriptReference/Events.UnityEvent_2.html
https://docs.unity3d.com/ScriptReference/Events.UnityEvent_3.html
https://docs.unity3d.com/ScriptReference/Events.UnityEvent_4.html

1 Like

I’ve only dabbled and used the button script provided by Unity. Should have known better. /informed

Unity’s docs are pretty useless. I wasn’t even positive you could pass arguments. I just tried it and it worked. :stuck_out_tongue:

2 Likes

You can’t add multiple arguments from the inspector. You are only allowed one. And it has to be of one of the supported types. But that list does include UnityEngine.Object, so you can group a bunch of paramaters in a MonoBehaviour or ScriptableObject and pass that.

Via code you can basically add any delegate you like, so it gets much more versatile.

2 Likes

Yeah I’ve attempted to read up on a few things around UI, but the docs can be… lacking.

and to think… soon you’ll be paying monthly for it :stuck_out_tongue: