Support => NGUI 3 Support => Topic started by: Tomleung on May 18, 2014, 02:47:25 AM
Title: Tweening problems
Post by: Tomleung on May 18, 2014, 02:47:25 AM
I have a situation here:
I have a gameobject that has two tween alpha scripts attached. One will start automatically at start and the another will run after finishing the first tween alpha script. In order to do this, I want to set when the first tween alpha script finished and the another tween alpha script runs and so I do it at OnFinished. However, when I want to select the method, I just can find one tween alpha script and select the relative actions. So it won't works. It seems that it can not identify multiple but same tween script all attached in one gameobject. How can I do?
Title: Re: Tweening problems
Post by: ArenMook on May 18, 2014, 11:38:25 AM
It's not easy to do this via inspector. Why have two alpha tweens on the same object? If you want to fade something in then fade something out, then play the same exact tween, just in reverse. Alternatively use PlayTween to trigger them and give them each a unique group ID.
Title: Re: Tweening problems
Post by: Tomleung on May 27, 2014, 05:06:57 AM
So if I want a UItexture first tweenalpha from 0 to 1 with 5 seconds duration
and then immediately tweenalpha from 1 to 0 with 2 seconds duration.
How to implement it? And it is automatically run and so UIplayTween seems not useful for this case.
Title: Re: Tweening problems
Post by: ArenMook on May 28, 2014, 06:52:32 AM
publicvoid PlayMyTween ()
{
TweenAlpha ta = TweenAlpha.Begin(gameObject, 5f, 1f);