Author Topic: Ignoring menu item NGUI error, Unity 5.4.1 plus Fix  (Read 13473 times)

chrisfirefox

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 9
    • View Profile
Ignoring menu item NGUI error, Unity 5.4.1 plus Fix
« on: September 09, 2016, 04:16:29 AM »
Hey Arenmook, after upgrading to Unity 5.4.1 (from 5.3.6p1) and upgrading to NGUI 3.10.1, Unity kept complaining on me on every recompile like this:
Quote
Ignoring menu item NGUI because it is in no submenu!
So I looked into it, and it turns out that this is the problem in NGUIMenu.cs Line 715+:
  1.        
  2.         [MenuItem("NGUI/", false, 11)]
  3.         static void Breaker () { }
  4.  
  5.         [MenuItem("NGUI/Help", false, 12)]
  6.         static public void Help () { NGUIHelp.Show(); }
  7.  

It can be easily fixed by removing the "Breaker" lines and increasing "Help" Priority by 10, like so:
  1.        
  2.         [MenuItem("NGUI/Help", false, 22)]
  3.         static public void Help () { NGUIHelp.Show(); }
  4.  

Then Unity shuts up :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Ignoring menu item NGUI error, Unity 5.4.1 plus Fix
« Reply #1 on: September 09, 2016, 02:50:21 PM »
Thanks, you can actually replace both of them with a single one:
  1. [MenuItem("NGUI/Help", false, 120)]
  2. static public void Help () { NGUIHelp.Show(); }