Author Topic: 2D UI and 3D UI Menu items are disabled under NGUI menu?  (Read 11206 times)

SmartyP

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
2D UI and 3D UI Menu items are disabled under NGUI menu?
« on: January 23, 2014, 10:07:56 AM »
In Unity if I go to the menu NGUI > Create, the '2D UI' and '3D UI' menu items are disabled / grayed out. If I open another scene they are working fine, so it seems specific to my scene. I tried deleting other UI's I have in the scene to see if it was some sort of limit, but had no luck. No luck searching so far either..

Thanks in advance!

Edit: Oh ya, I can get around it in the short term by copying/pasting a 3D root from another scene..

SmartyP

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #1 on: February 04, 2014, 10:42:07 AM »
Can someone please clue me in? I'm continually running into the 2D UI and 3D UI menu items being disabled. Is there a limit of 2 UIs per scene.. ?

Thanks again!

hazzy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 5
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #2 on: February 04, 2014, 11:59:47 AM »
Same thing is happening to me.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #3 on: February 04, 2014, 07:01:31 PM »
Strange, I don't think there's any limits to that. Try selecting something in the scene and see if it changes.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #4 on: February 05, 2014, 03:15:43 PM »
If you already have a UI in your scene, the option becomes disabled. Perhaps I shouldn't do it?

glennpow

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #5 on: June 13, 2014, 11:10:13 AM »
How would anyone have a combination of 2D and 3D UI's without allowing multiple NGUI roots?!  I think disabling the menu option is a very bad idea, and I'm not sure the reasoning.
And why did you remove the "Create GUI" dialog?  That's where you could set the desired layer.  Now you have to create it and then manually go in and change all the layer references.  What was the thinking here?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #6 on: June 13, 2014, 09:43:09 PM »
Why bump an old post? NGUI doesn't disable the menu options anymore if that type of UI doesn't exist. 2D UI and 3D UI are different menu options.

The UI layer is chosen automatically now. Unity 4.5 has a built-in layer called "UI". If you want to use something else, select the UIRoot and change its layer like any other game object.

glennpow

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #7 on: June 14, 2014, 01:07:09 AM »
I bumped the old post, because it was the one that I was dealing with the issue I was having.

I do see that there are 2 menu options, "2D UI" and "3D UI", however they were both disabled for me.  I looked in the code, and both menu items were being disabled by the same line of code: UIRoot.list.Count == 0.
Perhaps I have an older version of NGUI, but that doesn't allow one of each UI types to be created.  I went ahead and simply removed these checks, and now I can make my UI's just fine.

As for Unity 4.5's built in layers, I am still on 4.3.4, so perhaps that's why my layers still don't match up automatically.  Plus, I assume the 3D layer would need a new custom "UI3D" layer or something.

Anyway, sorry for rehashing an old thread, but there are quite a few versions of NGUI kicking around, and it's hard to stay up with the very latest.  Thanks for the response.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #8 on: June 15, 2014, 05:05:54 AM »
Quite a few versions kicking around? Unless you pirated it, there is only one version -- the latest.

sonicviz

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 58
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #9 on: June 15, 2014, 06:24:58 AM »
I came across this issue recently as well and can't understand the logic as to why they are disabled.

NGUI in theory can can contain multiple UI setups which may be split due to logical considerations.
A use case where everything is under one root is not the only one.

Why block the user from generating something automatically that just makes it faster to work?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #10 on: June 15, 2014, 06:52:30 AM »
The logic for the disabling was actually flawed. I just tweaked it some.

paulygon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #11 on: September 16, 2014, 10:49:12 AM »
Forgive me if necro posting is a serious no-no. My searching lead directly here, and the question for the original post wasn't clearly answered (for my humble abilities to comprehend ;) so I figured that staying here would help contain the issue to one place. I'm using version 3.7.2.

I have a project with MANY separate UIRoots with many different layouts and camera behaviors, and ways of layering those cameras. Various UIRoots are turned on and off as the user moves through the experience. From this thread I'm starting to wonder if my methods are somehow flawed, or if I'm missing something obvious about why you wouldn't ever want to use more than one UIRoot construct per scene. That philosophy is implied by making the menu item disabled when a UIRoot is detected. ArenMook indicated that disabling (graying out) the menu item NGUI >> CREATE >> 2D UI or 3D UI was removed, but it is definitely making this menu item unavailable for me when I forget to hide any of my other UIRoots. You'll note that hiding your other UIRoots is any ease work around.

Am I doing something I shouldn't be with my current methods? Why would you ever want to make this menu item unreachable? Is this a feature meant to help new users understand that in most cases you wouldn't want to have more than one UIRoot at a time? (and my project is either unique or flawed)

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #12 on: September 16, 2014, 06:55:07 PM »
It may be my limited vision, but I fail to see the advantage of having multiple UIRoots in the scene. Do you use different sizing schemes or something? What does that add that you can't do with a single root? It's always fun to see when people use stuff in unexpected ways, so I'm genuinely interested in why you would make it like that, paulygon. :)

Depending on how the different stuff in implemented, you might run into problems with getting UIRoot.pixelSizeAdjustment if you have multiple UIRoots in the same layer - it wouldn't know which to use.

paulygon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #13 on: September 16, 2014, 08:19:15 PM »
That's funny, I'm having trouble seeing the advantage of only one root then trying to manage 30+ panels and draggable cameras in that single node. Currently, I can turn off a single UIRoot to hide everything associated with the given UI. Maybe it doesn't really make a huge difference either way. It just seems like having this much content buried in a single parent would make working on the separate pieces a nightmare.

Here's a snapshot of my current setup. Each item labeled "scrolling text" is a UIRoot.
« Last Edit: September 16, 2014, 08:26:40 PM by paulygon »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2D UI and 3D UI Menu items are disabled under NGUI menu?
« Reply #14 on: September 17, 2014, 12:08:02 PM »
That's quite a mess you've got there. Here is what my UIRoot looks like in Windward: https://www.dropbox.com/s/xcl49on54dtreue/Screenshot%202014-09-17%2013.04.44.png?dl=0

Note how I have everything clean, and under one root? This way if I don't need to work with the UI, I only have to fold one object -- "2D UI" instead of 50-some like in your example.

All those objects underneath the 2D UI in my screenshot that have [XX] prefix are panels. I can open/hide them quickly from the Panel Tool, or just by selecting them and using ALT+SHIFT+A.