Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Alessaint on July 01, 2012, 08:04:45 AM
-
Hi,
does UIButtonPlayAnimation play an animation regardless of Time.timeScale value? I found this
1.50
NEW: The UI is now timeScale-independent, letting you pause the game via Time.timeScale = 0.
yet when I pause the game (Time.timeScale = 0) the animation doesn't play (otherwise it does). Should this work? Am I doing something wrong?
Thanks a lot
A.
-
I think there's a public bool you set in the inspector for the animation.
-
UIButtonPlayAnimation activates an animation via ActiveAnimation class, which samples it framerate-independent. Animation.Play() is not.
-
Thanks for the reply - unfortunately I'm not sure I fully understand though :)
Do you mean that UIButtonPlayAnimation doesn't rely on Animation.Play() and so it can play an animation even when the game is paused? Because I'm using UIDButtonPlayAnimation and yet I can't get it to work for some reason...
In another words -if I add UIButtonPlayAnimation to a button, fill in animation name and after pressing the button pause the game, the animation should still play?
Thanks
@Nicki: thanks for a hint - unfortunately I couldn't find anything like that in the animation's inspector settings
-
That's correct, UIButtonPlayAnimation does not rely on Animation.Play(). Did you set the target animation? It won't work without it.
-
Sorry for the bump, but there's anyway to play anims with timescale=0?
I couldn't find any option for that in the last version.
-
ActiveAnimation.Play is always timescale-independent, which is what UIPlayAnimation uses.