I have a button that is supposed to open a menu if I press it once and closes the menu if I press again - a simple Popup. I want to animate the open and close transition with two separate animations. Everything works fine for the first time but if you try to open the menu again, the open animation does not play and is stuck at the end.
I've tried several approaches to reset the animation, for instance:
m_OpenAnimation.target.Rewind();
or
m_OpenAnimation.target.Rewind(m_OpenAnimation.clipName);
or
ActiveAnimation.current.Reset()
but none of these approaches seem to work.
The only thing that does work is to play the animation backwards via
m_OpenAnimation.Play(false);
How can I reset the animation to the beginning?
Cheers