Hmm, except for the problem that you had the variable SkeletonAnimation type the same way as the type name, it seems not to have a major problem. To make things clear, the following simple code should work:
using UnityEngine;
using Spine.Unity;
public class HandleEvent : MonoBehaviour
{
SkeletonAnimation skeletonAnimation;
[SpineEvent]
public string attackEventName;
void Start () {
skeletonAnimation = GetComponent<SkeletonAnimation>();
skeletonAnimation.AnimationState.Event += HandleAnimationStateEvent;
}
private void HandleAnimationStateEvent (Spine.TrackEntry trackEntry, Spine.Event e) {
if (e.Data.Name == attackEventName) {
Debug.Log("Fired!");
}
}
}
You seem to be writing the event name directly in the code, but I think it would be more accurate to set it from the pull-down menu that appears in Inspector, so please check to see if the correct event name is specified that way.
By the way, when you post your code, please enclose it in [ code][/code] tags so that it can be displayed as shown above. (An extra space is added in front of "code" so that it can be displayed here, but it is unnecessary for actual use.)