[Unity] Atlas ingestion safety

https://github.com/EsotericSoftware/spine-runtimes/pull/259
This commit is contained in:
John 2015-12-29 04:12:05 +08:00
parent 9a7aeb1ae0
commit 0ea9bd216f

View File

@ -764,8 +764,8 @@ public class SpineEditorUtilities : AssetPostprocessor {
string[] atlasLines = atlasStr.Split('\n');
List<string> pageFiles = new List<string>();
for (int i = 0; i < atlasLines.Length - 1; i++) {
if (atlasLines[i].Length == 0)
pageFiles.Add(atlasLines[i + 1]);
if (atlasLines[i].Trim().Length == 0)
pageFiles.Add(atlasLines[i + 1].Trim());
}
atlasAsset.materials = new Material[pageFiles.Count];