[unity] Fixed skeleton binary import, was broken by recent changes. Closes #1259.

This commit is contained in:
Harald Csaszar 2019-01-21 15:06:02 +01:00
parent 3c06a0881f
commit 065c13f498

View File

@ -566,10 +566,10 @@ namespace Spine.Unity.Editor {
SkeletonBinary binary = new SkeletonBinary(new AtlasRequirementLoader(requiredPaths)); SkeletonBinary binary = new SkeletonBinary(new AtlasRequirementLoader(requiredPaths));
Stream input = null; Stream input = null;
TextAsset data = AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonDataPath); TextAsset data = AssetDatabase.LoadAssetAtPath<TextAsset>(skeletonDataPath);
if (data != null) { if (data == null) {
// On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null. // On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null.
// as a workaround, we provide a fallback reader. // as a workaround, we provide a fallback reader.
input = File.Open(skeletonDataPath, FileMode.Open); input = File.Open(skeletonDataPath, FileMode.Open, FileAccess.Read);
} }
else { else {
input = new MemoryStream(data.bytes); input = new MemoryStream(data.bytes);