Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - puargs

Pages: [1]
NGUI 3 Support / NullReferenceException in Prefab Toolbar with Unity 5 beta
« on: November 17, 2014, 06:00:24 PM »
Getting the following exception hundreds of times per second when attempting to use the prefab toolbar in Unity 5 beta with NGUI 3.7.6:
  1. NullReferenceException: Object reference not set to an instance of an object
  2. UIPrefabTool.OnGUI () (at Assets/NGUI/Scripts/Editor/UIPrefabTool.cs:937)
  3. 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)

My apologies if it has already been submitted. I looked for it but couldn't find it.

Necroing this thread, I apologize - but I ran into the same problem and discovered the problem was using the "Outline" or "Shadow" effect on a UI Label. Changing the effect to "None" took the number of vertices down to about 1% of what it was before.

Just wanted to post the solution if anyone else happens to look for it.

I have "fixed" the problem by changing my 3d UI to be exactly on the XYZ axis of the world view (zero rotation). Then set the scrolling to be only on the Y-axis.

This works for now, but I have a lot of camera moving back and forth between the 3d menus (because it looks cool), but I don't want to have to restrict my scrollable panels to be XYZ axis zero rotation only.

OK it looks like the "scale" value on "UIDraggablePanel" is what is throwing it off. The "Scale" value is NOT relative to the rotation of the object - it's relative to the rotation of the world. This is causing the object to go off on some wacky vector whenever I scroll.

OK I actually got it scrolling now, except it scrolls on the Z-axis instead of the X-Y axis??

The problem with it not scrolling was that the prefab I was using for the grid item didn't have the "UIDrag Panel Contents" script attached. Now that it is attached, it's getting the events, but it causes the panel to scroll along the Z axis! Note that the scrollbars themselves work fine along the x-y axis, but the scroll wheel for some reason does z axis instead.

I checked and the "Scroll" event is not even getting called when using the scrollwheel.

In my 3D UI, I have a UIPanel with a UIDraggable Panel Script attached. Underneath is a UI Grid with items that get attached programmatically. Everything seems to work fine and everything scrolls well, looks good etc.

Except the scroll wheel - the scroll wheel doesn't seem to do anything. No matter what number the "Scroll Wheel Factor" is set to (0, 1, 100, 1000, anything), it doesn't seem to work.

Any ideas on what I'm doing wrong?

Pages: [1]