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

This commit is contained in:
Harald Csaszar 2024-03-07 16:04:43 +01:00
parent 8e200efdbb
commit 795fb92080
2 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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",