1

Hi I try to create custom editor that automates creating character and also their respective animations.

How do i get spine animations list with unity custom editor ?

enter image description here

Tengku Fathullah
  • 1,279
  • 1
  • 18
  • 43

1 Answers1

2

Ok i found a solution, this is the answer incase you have same problem.

if( Selection.activeGameObject )
    {
        SkeletonAnimator spineScript = Selection.activeGameObject.GetComponent<SkeletonAnimator>();
        if (spineScript == null)
            return;

        SkeletonDataAsset m_skeletonDataAssets = spineScript.SkeletonDataAsset;

        if (m_skeletonDataAssets == null)
            return;

        SkeletonData m_skeletonData = m_skeletonDataAssets.GetSkeletonData(false);

        GUILayout.Label("Animation List");
        foreach (Spine.Animation animation in m_skeletonData.Animations) {
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label(animation.name);
            }
        }
    }
Tengku Fathullah
  • 1,279
  • 1
  • 18
  • 43