Author Topic: Tween Sequences, Chaining and Looping OnFinished EventDelegates  (Read 5499 times)

ngui

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Tween Sequences, Chaining and Looping OnFinished EventDelegates
« on: February 27, 2014, 01:13:57 PM »

I've noticed that when chaining OnFinished event delegates, that eventually loop back and replay. The delegate persist and will be performed at unwanted times or not in the order given.

What is the best way to create a sequence of tweens, that keeps its order?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween Sequences, Chaining and Looping OnFinished EventDelegates
« Reply #1 on: February 27, 2014, 04:54:25 PM »
For anything more complex than a transition from A to B, I strongly advise you to use an animation instead. Tweens are for simple things. The ability to chain them is neat, but ultimately limited.

ngui

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Tween Sequences, Chaining and Looping OnFinished EventDelegates
« Reply #2 on: February 27, 2014, 07:27:13 PM »
Thanks, so is there a way to remove the OnFinished delegate after use (for example from within the delegated method after its called)?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween Sequences, Chaining and Looping OnFinished EventDelegates
« Reply #3 on: February 28, 2014, 07:35:16 PM »
If you add delegates with the one shot parameter, they will remove themselves.
  1. static public void Add (List<EventDelegate> list, Callback callback, bool oneShot)

ngui

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Tween Sequences, Chaining and Looping OnFinished EventDelegates
« Reply #4 on: March 01, 2014, 02:04:07 AM »
that's great, Thanks!