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 ?
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 ?
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);
}
}
}