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

Pages: [1]
1
NGUI 3 Documentation / Re: UICamera
« on: September 02, 2014, 10:32:17 PM »
Problems with generic delegates(UICamera.onDrag,UICamera.onScroll,etc.).
Since I update the NGUI to 3.7.1 , there are new generic delegates to replace the old genericEventHandler GameObject.(Pro-tip#2)
So I want to modify my code , I was using the UICamera.genericEventHandler gameobject to handle OnPress,OnDrag and OnScroll message notified by UICamera in old version,and it works well.
Now I change my code using the UICamera.onPress,UICamera.onDrag and UICamera.onScroll delegates and problems come in.
The UICamera.onPress works well, but the UICamera.onDrag and UICamera.onScroll did not be called when mouse dragged or hovered on empty area(with no collider).
I suspected that some other delegates in UICamera may have the same problem -- process mouse or touch with empty target(no collider), while these problem would not happen when using the old UICamera.genericEventHandler.
After my experience, the UICamera.genericEventHandler cannot be null(you can even set an empty GameObject to it),otherwise the UICamera generic delegates would not be called properly.

2
NGUI 3 Documentation / Re: UICamera
« on: December 04, 2013, 05:13:27 AM »
There is issue of the onScreenResize delegate in UICamera...
The UICamera checks the screen size every frame update,but it's not good enough.
For example if I resize the player screen continuously, the screen size will change more than once in a frame update.
Here's the problem:In a frame update,the onScreenResize delegate was triggered once while the screen resize several times,some script(UIAnchor,UIStretch) who subscribed this delegate only get the size when the first time the screen changed,not the latest size.
So the UIAnchor or UIStretch would not get the newest,the right Screen.size when handle onScreenResize. (The UIAnchor or UIStretch with "Run Only Once" checked.)

My suggestion is:When the screen size changed, invoke the onScreenResize delegate at the end of frame or next frame.

Pages: [1]