EnterCurrentAniData.cs 906 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ChivaXR;
  5. public class EnterCurrentAniData : MonoBehaviour
  6. {
  7. bool EditorMode = true;
  8. private void Awake()
  9. {
  10. EditorMode = false;
  11. }
  12. public void EnterCurrentAni(AniData aniData)
  13. {
  14. if (!EditorMode) return;
  15. Debug.Log(aniData.aniName);
  16. bool firstUnityAnimation = false;
  17. for (int i = 0; i < aniData.AnimationDriverDatas.Count; i++)
  18. {
  19. if (!firstUnityAnimation)
  20. {
  21. if ((aniData.AnimationDriverDatas[i] as AniDriver_UnityAnimation) == null)
  22. aniData.AnimationDriverDatas[i].FinishedState();
  23. else
  24. firstUnityAnimation = true;
  25. }
  26. else
  27. {
  28. aniData.AnimationDriverDatas[i].InitState();
  29. }
  30. }
  31. }
  32. }