16
NGUI 3 Support / Re: UiCenterOnChild -- Did something change?
« on: June 21, 2014, 04:40:30 AM »
A couple more issues:
1. In the inspector, the CenterOnChild comp is enabled and the items in the SV are populated dynamically. After populating, the the CenterOnChild doesn't work, I have to manually deactivate and activate it then it starts working.
2. When the user drags the SV to a new child, I would like to be able to get an event ASAP when the CenterOn() is finished. ATM, the available methods of getting the new child is not working fast enough. I'm using onFinished event which is quite bit of time after the CenterOn finishes. I added :
public delegate void OnCenteredObjectCallBack (GameObject centeredObject);
public static event OnCenteredObjectCallBack OnCenteredObject;
and to the bottom of the CenterOn() method:
else mCenteredObject = null;
if(OnCenteredObject != null)
OnCenteredObject(mCenteredObject);
This gives the desired result. Can you add this functionality in a future version so that I don't have to add the changes to NGUI with each new version.
Cheers.
1. In the inspector, the CenterOnChild comp is enabled and the items in the SV are populated dynamically. After populating, the the CenterOnChild doesn't work, I have to manually deactivate and activate it then it starts working.
2. When the user drags the SV to a new child, I would like to be able to get an event ASAP when the CenterOn() is finished. ATM, the available methods of getting the new child is not working fast enough. I'm using onFinished event which is quite bit of time after the CenterOn finishes. I added :
public delegate void OnCenteredObjectCallBack (GameObject centeredObject);
public static event OnCenteredObjectCallBack OnCenteredObject;
and to the bottom of the CenterOn() method:
else mCenteredObject = null;
if(OnCenteredObject != null)
OnCenteredObject(mCenteredObject);
This gives the desired result. Can you add this functionality in a future version so that I don't have to add the changes to NGUI with each new version.
Cheers.