Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: hotshots on November 28, 2014, 03:58:58 AM

Title: Unity 4.6 and Ngui 3.7.5 problem
Post by: hotshots 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.
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: Nicki on November 28, 2014, 05:29:45 AM
We're gonna need some more details than that. What specifically happens?
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: hotshots 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.
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: konsnos 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?
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: ArenMook 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...
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: hotshots on December 03, 2014, 07:49:58 AM
yes cant move buttons to ngui canvas
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: Kval 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.
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: Benzino07 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.
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: ArenMook 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.
Title: Re: Unity 4.6 and Ngui 3.7.5 problem
Post by: Benzino07 on December 04, 2014, 04:42:34 AM
Ah ok, I was not aware that there was a newer version of NGUI out. Thanks.