Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: grofie on January 28, 2014, 11:00:51 AM

Title: Unity animations are not working
Post by: grofie on January 28, 2014, 11:00:51 AM
Hi Aren,

our game developper prefers to make animations over the unity editor instead of using tweens. This works fine for manipulating the transform values of an UI element. But i.e. changing the color brings strange behaviours. When changing a label or sprite color over the inspector, the change can be seen in game immediately. However, when it is changed by the unity animation, the color in the inspector changes but not in the game. Only on some rare moments, the color does change in game but without any interpolation.

What are we doing wrong? Is there an extra option to set?

Thx in advance and kind regards,
grofie
Title: Re: Unity animations are not working
Post by: ArenMook on January 28, 2014, 11:33:59 AM
You need to use an intermediary script as Unity doesn't offer a way to animate properties -- only variables, and it picks up hidden variables such as "MColor", which are private and should not be edited.

UIAnimatedColor, UIAnimatedAlpha -- look at these scripts and how they get around the problem. Attach one of them and animate their values instead of the widget's.
Title: Re: Unity animations are not working
Post by: grofie on January 29, 2014, 05:43:40 AM
Merci beaucoup  ;D