Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: ENAY on May 28, 2012, 07:09:02 AM
-
Not sure how to use this function. I have my gfx ready to apply my color tween, not exactly what the Event Receiver means. I basically just want to start().
-
Ok I have some more progress. But as soon as the game starts it pingpongs automatically forever. All I want to do is .PlayOnce whenever I call it. For some reason this seems quite a bit more complicated that the UiButton Color feature. I really am getting quite stuck.
-
UIButtonColor isn't a tween, it just triggers tweens. TweenColor, on the other hand, is an actual tween, so they behave differently. Triggering via code, you would use TweenColor.Begin. Via inspector? Add the tween color, set it to play forward.
-
Well, I don't understand it all. If I enable the TweenColor in the inspector it just plays automatically and forever as soon as the program starts, I have no control over it at all.
TweenColor.Begin doesn't work for me, I have no idea where to call it. And I have my TweenColor attached to a UILabel and TweenColor.Begin requires a GameObject. So I am stuck with a Tweencolor that either never starts or just plays uncontrollably.
-
I basically want to do this:-
- Drag and drop the TweenColor script to an object inside my Menu Hierachy
- Do something like this:-
if (blah == true)
{
TweenColor.Begin(TheMenu.GetComponentsInChildren<UISprite>()[0], 1.2, Color.yellow); //
}
or
if (blah == true)
{
TheMenu.GetComponentsInChildren<TweenColor>()[0].begin(); // As all set in the script already
}
-
Well, I don't understand it all. If I enable the TweenColor in the inspector it just plays automatically and forever as soon as the program starts, I have no control over it at all.
o_O? Sure you do. Just disable the script.
-
Ok so when I disable it, if I call the Begin function, it will just enable it for a single play?
Still not quite sure how to do that though since I get a compile error as it is expecting a GameObject and not a UILabel.
Will have to take another look I think.
-
That's how it works, yeah. Note the second example, it does just that.
-
Absolutely haven't got a single clue.
I can't choose a component, so I put the whole menu gameobject in and something that doesn't have the script attached randomly turns yellow, and after calling it only once in the code, the whole thing stays yellow forever. It does not play once.
-
o_O?
You can separate tweens into groups if you have more than one tween on the same object. Also make sure that the include children checkbox isn't checked.