Author Topic: Unity 4.6 and Ngui 3.7.5 problem  (Read 12186 times)

hotshots

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Unity 4.6 and Ngui 3.7.5 problem
« on: November 28, 2014, 03:58:58 AM »
I installed unity 4.6 and imported my old project. But ngui canvas came not correct. i can't use ngui with 4.6 version. need help urgently.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #1 on: November 28, 2014, 05:29:45 AM »
We're gonna need some more details than that. What specifically happens?

hotshots

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #2 on: December 02, 2014, 08:26:27 AM »
NGUI canvas position problem. buttons outside of ngui canvas. but 4.5 was not problem. so i cant use unity 4.6 now.

konsnos

  • Newbie
  • *
  • Thank You
  • -Given: 8
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #3 on: December 02, 2014, 10:44:12 AM »
NGUI canvas position problem. buttons outside of ngui canvas.
Can't you put the buttons inside the NGUI Canvas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #4 on: December 02, 2014, 12:29:35 PM »
NGUI canvas position problem. buttons outside of ngui canvas. but 4.5 was not problem. so i cant use unity 4.6 now.
That really doesn't explain anything...

hotshots

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #5 on: December 03, 2014, 07:49:58 AM »
yes cant move buttons to ngui canvas

Kval

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #6 on: December 03, 2014, 08:05:38 AM »
Hey, just chiming in on this one with some more info:

In the editor: all widgets parented directly under my UIRoot snaps to the center of said UIRoot and can not be moved. The representation of how they are anchored relative to the screen is lost as it's just a pile of stuff on top of each other in the center. It makes it hard to work with the layout.

It works just fine once the game runs however.

Benzino07

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 24
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #7 on: December 03, 2014, 11:30:33 AM »
Getting the same thing that kval mentioned. Everything is snapped to the center, but corrects itself when in play mode.

To expand on this, and it may not be related, selecting one of these NGUI elements, such as a label, in the editor results in 22 errors, all:

  1. The serializedObject should not be used inside OnSceneGUI or OnPreviewGUI. Use the target property directly instead.
  2. UnityEditor.GameObjectInspector:OnEnable()

Edit 2: This is another error that occurs when selecting elements:

  1. NullReferenceException: Object reference not set to an instance of an object
  2. UIPanel.get_worldCorners () (at Assets/NGUI/Scripts/UI/UIPanel.cs:616)
  3. UIWidgetInspector.DrawAnchorHandle (.AnchorPoint anchor, UnityEngine.Transform myTrans, UnityEngine.Vector3[] myCorners, Int32 side, Int32 id) (at Assets/NGUI/Scripts/Editor/UIWidgetInspector.cs:335)
  4. UIWidgetInspector.OnSceneGUI () (at Assets/NGUI/Scripts/Editor/UIWidgetInspector.cs:448)
  5. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
  6. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  7. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
  8. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
  9. UnityEditor.SceneView.CallOnSceneGUI ()
  10. UnityEditor.SceneView.HandleSelectionAndOnSceneGUI ()
  11. UnityEditor.SceneView.OnGUI ()
  12. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Hopefully the above can be of some help locating the cause of these issues.
« Last Edit: December 03, 2014, 11:39:34 AM by Benzino07 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #8 on: December 04, 2014, 03:47:38 AM »
You guys need to update to NGUI 3.7.6. That's what that release was for -- to add a work-around for a bug Unity introduced in their last few patches/versions.

Benzino07

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 24
    • View Profile
Re: Unity 4.6 and Ngui 3.7.5 problem
« Reply #9 on: December 04, 2014, 04:42:34 AM »
Ah ok, I was not aware that there was a newer version of NGUI out. Thanks.