OnAnimationEndDelegate
by Amit Mathew · in Torque X 2D · 04/28/2007 (1:55 pm) · 3 replies
I'm trying to perform some action when a given animation ends, but so far I've had no luck getting the onAnimationEndDelegate to fire. I've tried setting the OnAnimationEnd member and using ProcessList.AddAnimationCallback(), but none of those have worked. Thanks!
#2
To remove:
05/14/2007 (6:33 pm)
To add a delegate to a T2DAnimatedSpriteObject//populate T2DAnimatedSprite _player = TorqueObjectDatabase.Instance.FindObject<T2DAnimatedSprite>(_sceneObject.Name); _player.OnAnimationEnd += new T2DAnimatedSprite.OnAnimationEndDelegate(OnAnimationEnd);
To remove:
_player.OnAnimationEnd -= new T2DAnimatedSprite.OnAnimationEndDelegate(OnAnimationEnd);
public void OnAnimationEnd()
{
//Stuff Here
}
#3
05/24/2007 (9:11 am)
Matias had it right. The 'new' statement isn't neccesary.
Torque Owner Matias Kiviniemi
All you have to do is to make sure that your function matches the delegate type, i.e. has the right parameters (check reference api or GSE tooltips).
Matias