Author Topic: Disable after reverse ?  (Read 2253 times)

Panda313

  • Guest
Disable after reverse ?
« on: October 08, 2012, 04:54:40 AM »
Hi guys

I've been looking around for an answer to my question... But I couldn't find any. Here is the thing :
I want to play tween on widgets  (fade in/change positions), froward and backward depending on case.
In my hierarchy, I put the tween on the the widgets with the label and I put the collider and the UIButtontween on a parent.
I'm sending message when I need to or I'm using the collider to detect the mousse press.

Here is my unity configuration :


The thing is, the backward tween never works...
The only way I can get it play backward is setting toggle on "OnPressFalse". But then, disable won't work...

Any ideas ?

Finally, congrats for such a great tool.

Regards

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disable after reverse ?
« Reply #1 on: October 08, 2012, 08:12:22 AM »
If you set the condition to disable the object, then its collider also gets disabled, so there is nothing around to receive your event.

Panda313

  • Guest
Re: Disable after reverse ?
« Reply #2 on: October 08, 2012, 08:17:03 AM »
Hum ok thanks. However  it doesn't explain why reverse doesn't work (only toggle works to make it backward)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disable after reverse ?
« Reply #3 on: October 08, 2012, 08:26:47 AM »
How are you trying to play it backwards? Look into UIButtonTween's code -- its has certain triggers that will play in certain directions. For example OnPress(true) will play an animation forward and OnPress(false) will play it in reverse. If you're having trouble, just write your own small script that does what you want:
  1. target.GetComponent<UITweener>().Play(...)
or the more direct:
  1. TweenPosition.Begin(target, ...)
(or any other tween, of course)

Panda313

  • Guest
Re: Disable after reverse ?
« Reply #4 on: October 08, 2012, 08:28:47 AM »
I'm using OnPress(False) but it just don't want to play backward. The only way I make it fade out is by uing the direction "toggle" instead of "reverse".
I'll try using a script

I'll keep you posted.

thanks !