Procházet zdrojové kódy

[unity] Fixed SkeletonBinary hash `{"` accidentally being detected as json. Closes #2474.

Harald Csaszar před 1 rokem
rodič
revize
795fb92080

+ 6 - 0
spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs

@@ -163,6 +163,12 @@ namespace Spine.Unity {
 
 		public static bool IsJsonFile (TextAsset file) {
 			byte[] content = file.bytes;
+
+			// check for binary skeleton version number string, starts after 8 byte hash
+			char majorVersionChar = compatibleBinaryVersions[0][0].ToString()[0];
+			if (content.Length > 10 && content[9] == majorVersionChar && content[10] == '.')
+				return false;
+
 			const int maxCharsToCheck = 256;
 			int numCharsToCheck = Math.Min(content.Length, maxCharsToCheck);
 			int i = 0;

+ 1 - 1
spine-unity/Assets/Spine/package.json

@@ -2,7 +2,7 @@
 	"name": "com.esotericsoftware.spine.spine-unity",
 	"displayName": "spine-unity Runtime",
 	"description": "This plugin provides the spine-unity runtime core.",
-	"version": "4.1.37",
+	"version": "4.1.38",
 	"unity": "2018.3",
 	"author": {
 		"name": "Esoteric Software",