106
DOTween & DOTween Pro / Re: How to smoothly kill an infinite loop sequence
« on: November 23, 2015, 12:04:35 PM »
You're right about the TweenCallback, I forgot that Restart has overloads, so it requires to be a lambda.
This won't work, because you're simply forcing the tween to complete instantly. With the method I wrote instead, you're telling the tween to go on playing until the end of the loop, and then it will kill itself automatically (which sounds creepy written like this ).
Code: [Select]
void SmoothKillTween()
{
myTween.SetLoops(0);
myTween.Complete();
myTween.Kill(); //?
}
This won't work, because you're simply forcing the tween to complete instantly. With the method I wrote instead, you're telling the tween to go on playing until the end of the loop, and then it will kill itself automatically (which sounds creepy written like this ).