Hi,
I have been using a lot of tweens to animate my UI with a lot of PlayForward and PlayReverse, depeding on the state of the game and I've been running into various problems
To easily test, please modify UITweener.cs to add a context menu to them
[ContextMenu("PlayForward")]
public void PlayForward()
[ContextMenu("PlayReverse")]
public void PlayReverse()[/td]
Then create a simple scene with a sprite and a tween position
- The tween will run when you start the scene
x Play Reverse, the item "jumps" to From
x Play Format, same as play reverse
Is the way I am using it wrong ?
I found the following workaround to be working:
public static void Play(this TweenPosition tween, Vector3 from, Vector3 to, float duration)
{
tween.from = from;
tween.to = to;
tween.duration = duration;
tween.ResetToBeginning();
tween.ignoreTimeScale = false;
tween.PlayForward();
}
But I will still have problems after call PlayReverse() so I have to addcomponent tween and destroy them during onEnable and onDisable/
Also sometimes, OnFinished is not correctly called
Is something wrong with my usage ?