Author Topic: do something at the end of tween animation  (Read 1351 times)

jimbbq

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
do something at the end of tween animation
« on: April 24, 2014, 08:45:09 AM »
Hi

I am trying to call a function at the end of a tweening animation, but I have no idea how to do this. Is there something like?

void onEndTween(){

}


thanks


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: do something at the end of tween animation
« Reply #1 on: April 25, 2014, 05:31:59 AM »
All tweens have the onFinished delegate. You can set it in inspector, or via code:
  1. TweenPosition tp = TweenPosition.Begin(...);
  2. EventDelegate.Add(tp.onFinished, YourFunction);

jimbbq

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: do something at the end of tween animation
« Reply #2 on: April 25, 2014, 10:50:01 AM »
thanks a lot for your help! you are a star!!!