hi!
Here is my code:
public void Start(){
anim.state.Start += testStart;
anim.state.Event += Dealdamage;
}
void Dealdamage (object sender, Spine.EventTriggeredArgs e)
{
Debug.Log ("DealDamage");
}
void testStart (object sender, Spine.StartEndArgs e)
{
Debug.Log ("Start");
}
The Start event works well but my event Dealdamage doesn't. It's on a mob animation when he attacks with his sword, but no Debug Log appears when he does, except the "Start" log.
Any idea on what can messed up with my event? Code looks good, I have the good skeleton.json on my character too.
(Spine v 1.8.14)
EDIT: Found this on my skeleton.json: "events":[{"time":1.6666,"name":"Dealdamage"}]
EDIT: I've updated the c-sharp runtime and modify my code by:
public void Start(){
anim.state.Start += testStart;
anim.state.Event += Dealdamage;
}
void Dealdamage (Spine.AnimationState state, int trackIndex, Spine.Event e)
{
Debug.Log ("Dealdamage");
}
void testStart (Spine.AnimationState state, int trackIndex)
{
Debug.Log ("Start");
}
Same problem.
EDIT: Found something. When I use AddAnimation to set my attack animation with my event, Dealdamage is not found but if I launch my animation by setting animation variable in SkeletonAnimation with "attack", it works!
So new question, why when we use AddAnimation it doesn't change SkeletonAnimation.animation et SkeletonAnimation.loop automaticaly?
(Last) EDIT: to fix my problem I use now:
anim.animationName = "attack";
anim.state.AddAnimation(0,"attack",false,0);
All work fine! 🙂 #SelfHighFive