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 - bfriedman

Pages: [1]
1
FYI a workaround for me is to toggle between this two modes:

  1.                 Screen.orientation = Screen.orientation;
and
  1.                 Screen.orientation = ScreenOrientation.AutoRotation;

That moves between freezing the orientation, and setting back to auto.  That may not work for everyone.  My particular use-case simply requires temporarily disabling auto-rotation while my gyro mode is active.  I don't care if it's in portrait or landscape when that happens.  Then I restore it to auto when my gyro mode is deactivated.

Whatever is wrong with Unity's orientation changing logic, moving between these two modes doesn't cause errant behavior at least.

2
I've isolated the problem as a unity issue and built a test project to show it.  I submitted it to Unity as a bug.  Will update if I get a tracking number or response.

-brad

3
So upon doing some debugging on the device (iPad), I find that after the screen rotation, Unity is reporting touch positions as negative in x.  If I break inside UICamera.ProcessTouhces and look at the touch returned by calling Unity's "Input.GetTouch(i)", and watch it's position and rawPosition fields, I get negatives.  Which I believe is a Unity bug.  Though I suppose it could instead be intended behavior I don't understand.  I'll be moving investigation in that direction.

Anyhow, as far as NGUI goes:  Later on in NGUI's logic, it skips touches outside the 0-1 range.  Which is correct behavior I believe.

4
FYI, I have this exact problem as well.  Unity 4.5.1p3,  NGUI just updated via asset store, so I guess 3.6.6?  In my case, NGUI works perfectly fine letting Unity auto-rotate the GUI.  But when I programmatically change to:

  1.                 Screen.orientation = ScreenOrientation.Landscape;

During normal user input handling, I get no more events from the UICamera when running in iOS.

So NGUI updates the layout to the new orientation.  But events stop flowing to it.  I do get them when running in Android.  Everything seems fine there.

Anecdotally, the gyro input that I'm running in parallel (outside of the NGUI system) continues to work fine.  So Unity itself isn't frozen.  It's just the UI events that are not flowing.

I'm about to dig into this.  But thought I'd confirm it as best I can.

Pages: [1]