Hi there,
I'm interested in populating several array lists with the names of the animations contained in their folders in Spine.
I know you can find animations by name, but what I'm interested in this case is to pass a partial path pointing to a specific folder, and get all the animation names it contains to a string array, or something similar.
Is that possible with some method I'm not aware of?
I'm using the latest 3.8 runtimes and Unity 2019.4.
Thanks!
Okay, after some further research I'll reply to myself, so other newbies like me can benefit.
This seems to do the trick...:
SkeletonData skeletonData = skeleton.SkeletonDataAsset.GetSkeletonData(true);
foreach (var animation in skeletonData.Animations)
{
if (animation.Name.ToString().Contains(path.Value))
{
matchingAnimations.Resize(matchingAnimations.Length + 1);
matchingAnimations.Set(matchingAnimations.Length - 1, animation.Name.ToString());
}
};
I'm using an FSM Array from PlayMaker, so you mileage may vary a bit if you're going to use another structure type.
And I can imagine something similar can be made for Skins.
Cheers.