Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Alessaint on July 01, 2012, 08:04:45 AM

Title: Paused game
Post 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.
Title: Re: Paused game
Post by: Nicki on July 01, 2012, 10:19:02 AM
I think there's a public bool you set in the inspector for the animation.
Title: Re: Paused game
Post by: ArenMook on July 01, 2012, 11:32:08 AM
UIButtonPlayAnimation activates an animation via ActiveAnimation class, which samples it framerate-independent. Animation.Play() is not.
Title: Re: Paused game
Post by: Alessaint on July 02, 2012, 02:52:37 AM
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
Title: Re: Paused game
Post by: ArenMook on July 02, 2012, 12:40:10 PM
That's correct, UIButtonPlayAnimation does not rely on Animation.Play(). Did you set the target animation? It won't work without it.
Title: Re: Paused game
Post by: jeldrez on February 17, 2014, 10:41:25 AM
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.
Title: Re: Paused game
Post by: ArenMook on February 17, 2014, 10:46:53 AM
ActiveAnimation.Play is always timescale-independent, which is what UIPlayAnimation uses.