mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 23:34:53 +08:00
[unity] Fixed json vs binary file detection.
This commit is contained in:
parent
39dfca8263
commit
8ea166b331
@ -173,11 +173,16 @@ namespace Spine.Unity {
|
||||
int i = 0;
|
||||
if (content.Length >= 3 && content[0] == 0xEF && content[1] == 0xBB && content[2] == 0xBF) // skip potential BOM
|
||||
i = 3;
|
||||
bool openingBraceFound = false;
|
||||
for (; i < numCharsToCheck; ++i) {
|
||||
char c = (char)content[i];
|
||||
if (char.IsWhiteSpace(c))
|
||||
continue;
|
||||
return c == '{';
|
||||
if (!openingBraceFound) {
|
||||
if (c == '{') openingBraceFound = true;
|
||||
else return false;
|
||||
} else
|
||||
return c == '"';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user