Author Topic: Tween - Call method when finished.  (Read 6061 times)

DukeGrimm

  • Guest
Tween - Call method when finished.
« on: May 06, 2013, 10:31:03 AM »
I'm making a GUI window that shrinks open or close, and appears before tween and disappears after tween. However, I can get the tween to occure using TweenScale but I can't seem to figure out how to get the Tween to call a method when it has shrunk the UI to disable it.

Anyone know how to correctly queue a method call for when the tween is completed?

MrTact

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 32
    • View Profile
Re: Tween - Call method when finished.
« Reply #1 on: May 06, 2013, 03:31:01 PM »
The tween component in the inspector has fields called "Event receiver" and "Call when done". Drag the object you want to be notified when the tween completes into the event receiver field, and type the name of the function you want called into the the call when done field.

DukeGrimm

  • Guest
Re: Tween - Call method when finished.
« Reply #2 on: May 06, 2013, 04:01:32 PM »
Yeppers, I just got it working!

The key is placing the script on the object rather than creating an instance of the class in the script and trying to set it's attributes in the background.