Hello,
I have the following code that I have attached to the game object that also contains a UIInput component:
public void OnSelect()
{
Vector3 destination
= new Vector3
( inputContainer.localPosition.x,
targetYCoordinate,
inputContainer.localPosition.z
);
TweenPosition.Begin(inputContainer.gameObject, 0.50f, destination);
}
public void OnClose(string text)
{
Debug.Log(initialPosition);
TweenPosition.Begin(inputContainer.gameObject, 0.25f, initialPosition);
}
The OnSelect code works perfectly, and the object tweens to the correct position. However, the OnClose function does not work, as the object does not move at all (NOTE: I set up the event delegate in OnEnable() which is not shown here and I know it is working because the Debug.Log(initialPosition) shows up in the console). When I inspect the TweenPosition component, the "to" property and the "duration" property are both unchanged but the "from" property is.
How can I start a tween to initialPosition?
UPDATE: Even when I use the following code, it results in the same behavior.
public void OnClose(string text)
{
inputContainer.GetComponent<TweenPosition>().Toggle();
}
I am using NGUI 2.6.4.