Im using Unity 5 and the latest Spine runtime, Spine 2.1.25 ESS:
Opened SpineBoy example in Spine.
Created a Unity 5 project and imported Spine runtime package.( Got some warnings about old APIs. )
Exported SpineBoy to a folder under Assets in the Unity project, 3 files exported: "spineboy.atlas", "spineboy.json", "spineboy.png".
Unity editor got the assets changed event and this function is called:
static void OnPostprocessAllAssets (string[] imported, string[] deleted, string[] moved, string[] movedFromAssetPaths) {
ImportSpineContent(imported, false);
}
static List<AtlasAsset> FindAtlasesAtPath (string path) {
List<AtlasAsset> arr = new List<AtlasAsset>();
DirectoryInfo dir = new DirectoryInfo(path);
FileInfo[] assetInfoArr = dir.GetFiles("*.asset");
int subLen = Application.dataPath.Length - 6;
foreach (var f in assetInfoArr) {
string assetRelativePath = f.FullName.Substring(subLen, f.FullName.Length - subLen).Replace("\\", "/");
Object obj = AssetDatabase.LoadAssetAtPath(assetRelativePath, typeof(AtlasAsset));
if (obj != null) {
arr.Add(obj as AtlasAsset);
}
}
return arr;
}
Here path is "Assets/SpineBoy", I dont understand why is it looking for files with ".asset" extensions, there is no such file in this folder:
var localAtlases = FindAtlasesAtPath(dir);
localAtlases is an empty list.
I think this is a bug.