tony020409

我想嘗試觸發自定義的動畫事件
但是在start中 註冊的HandleEvent事件沒有觸發到
必須要用以下方法 晚點註冊 才能觸發事件
請問這個問題可能是什麼原因造成的? :'(
using Spine;
using Spine.Unity;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AnimationEvent : MonoBehaviour
{
public SkeletonAnimation skeletonAnimation;

public void Start()
{
skeletonAnimation = GetComponent<SkeletonAnimation>();
skeletonAnimation.AnimationState.Event += HandleEvent;
StartCoroutine(InitEvent());
}

IEnumerator InitEvent()
{
yield return Yielders.WaitForSeconds(1);
skeletonAnimation.AnimationState.Event += HandleEvent;
}
void HandleEvent(Spine.TrackEntry trackEntry, Spine.Event e)
{
Debug.Log("Fire_Movent");
if (e.Data.Name == "Fire_Movent")
{
Debug.Log("Fire_Movent");
}
Debug.Log("Fire_Movent");
}
}
tony020409
  • Messaggi: 7

Harald

我已经在这个论坛帖子上回复了:
SpineEvent Question
让我们在这个线程上继续讨论。
-----
I have replied on this forum thread:
SpineEvent Question
Let's please continue the discussion over at this thread.
Avatar utente
Harald

Harri
  • Messaggi: 4206


Torna a 中国Spine用户