Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: jeldrez on March 18, 2013, 12:35:08 PM
-
How I play animations in a different sprite using UIButtonPlayAnimation, I want to press a button and move a different element.
I didn't realize how to do it.
-
aynone?
-
If you want to switch a sprite to a specific one, then do just that -- sprite.spriteName = "abc".
-
If you want to switch a sprite to a specific one, then do just that -- sprite.spriteName = "abc".
Sorry, but I didn't get it.
What I want it's moving other widgets pressing a button with PlayAnimation, not changing the name, or I'm not getting it?
-
I'm not sure what you are trying to do. UIButtonPlayAnimation allows you to trigger an animation. But you have to create this animation first using the Unity's animation window tool (CTRL+6). For how to create this animation, consult Unity's documentation.
-
I've already done the animations, but what I figure out it's that UIButtonPlayAnimation just play animations attached to the widget.
UIRoot
- Camera
-- Anchor
--- Panel1
---- Button1 (UIButtonPlayAnimation)
--- Panel2
--- Button2 (with animation attached) <- this should move when pressing Button1
I want when you press Button1 it moves Button2, so I attached animation on Button2. Because if I attached to Button1 it moves this button instead Button2.
I'm doing it wrong? that's not the way?
-
UIButtonPlayAnimation has a "target" parameter which determines which animation it will play.
-
UIButtonPlayAnimation has a "target" parameter which determines which animation it will play.
Ohh, sorry, I was trying to drop just the animation on the target parameter, and that doesn't work, now I just drag and drop the widget that contains the animation and it works perfectly.
Thanks a lot Aren! (mostly for your patience!)