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

Pages: [1]
1
NGUI 3 Support / UICamera Lateupdate change
« on: September 07, 2016, 08:08:50 PM »
Hello again,

We are trying out a change to UICamer Lateupdate.  We want to move the UIRoot.Broadcast("UpdateAnchors"); statement to after the onScreenResize(); call (line 1736ish).

This is changing the order of onScreenResize and UpdateAnchors. Previously, it called UpdateAnchors first then call onScreenResize. This could cause a problem if there are some UI Widget is using an UISretch object as anchors' target.

Usually onScreenResize won't be called on mobile devices except one situation: lock the android device when game running (I was using Sony Z1) and unlock it, you will receive two on ScreenResize call which the first one report change with portrait screen size then the second one with landscape screen size.

Do you see any issues with this change?

Thanks

Jobe

2
It only happens on device on Android (IL2CPP).  No idea why, but like I said the null check fixed it up.

3
Stack trace looks like this:
07-13 16:36:53.702 27259 27280 I Unity   : NullReferenceException
07-13 16:36:53.702 27259 27280 I Unity   :   at UnityEngine.Transform.get_position () [0x00000] in <filename unknown>:0
07-13 16:36:53.702 27259 27280 I Unity   :   at UIAnchor.Update () [0x00000] in <filename unknown>:0
07-13 16:36:53.702 27259 27280 I Unity   :   at UIAnchor.ScreenSizeChanged () [0x00000] in <filename unknown>:0
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper delegate-invoke) UICamera/OnScreenResize:invoke_void__this__ ()
07-13 16:36:53.702 27259 27280 I Unity   :   at (wrapper

We believe is an issue inside UIAnchor.Update where mTrans is null.  Adding null checks for mTrans seems to resolve the issue.

Pages: [1]