1
Support / Re: Help with Returning to a Sprite after Animation Ends
« on: September 27, 2013, 10:45:20 pm »
The docs here show how it is done.
It uses delegates, which basically allow a method to be assigned as a parameter, and that method is then called when the animation finishes.
Here are the relevant bits from the above docs. You set up a method with the required signature:
And then after you start your animation, you tell it to call the above method when it's finished, like so:
It uses delegates, which basically allow a method to be assigned as a parameter, and that method is then called when the animation finishes.
Here are the relevant bits from the above docs. You set up a method with the required signature:
Code: [Select]
void HitCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip) {
//code in here will be executed when your anim is finished
}
And then after you start your animation, you tell it to call the above method when it's finished, like so:
Code: [Select]
anim.AnimationCompleted = HitCompleteDelegate;