mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Fixed SkeletonBinary hash {" accidentally being detected as json. Closes #2474.
This commit is contained in:
parent
8e200efdbb
commit
795fb92080
@ -163,6 +163,12 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
public static bool IsJsonFile (TextAsset file) {
|
public static bool IsJsonFile (TextAsset file) {
|
||||||
byte[] content = file.bytes;
|
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;
|
const int maxCharsToCheck = 256;
|
||||||
int numCharsToCheck = Math.Min(content.Length, maxCharsToCheck);
|
int numCharsToCheck = Math.Min(content.Length, maxCharsToCheck);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity",
|
"name": "com.esotericsoftware.spine.spine-unity",
|
||||||
"displayName": "spine-unity Runtime",
|
"displayName": "spine-unity Runtime",
|
||||||
"description": "This plugin provides the spine-unity runtime core.",
|
"description": "This plugin provides the spine-unity runtime core.",
|
||||||
"version": "4.1.37",
|
"version": "4.1.38",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user