mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '3.8' into 4.0-beta
This commit is contained in:
commit
2b21c8f8d2
@ -294,7 +294,7 @@ namespace Spine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void Draw(GameTime gameTime) {
|
protected override void Draw(GameTime gameTime) {
|
||||||
currentScreen.Render(gameTime.ElapsedGameTime.Milliseconds / 1000.0f);
|
currentScreen.Render((float)(gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,11 +167,14 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsJsonFile (TextAsset file) {
|
public static bool IsJsonFile (TextAsset file) {
|
||||||
string fileText = file.text;
|
byte[] content = file.bytes;
|
||||||
const int maxCharsToCheck = 256;
|
const int maxCharsToCheck = 256;
|
||||||
int numCharsToCheck = Math.Min(fileText.Length, maxCharsToCheck);
|
int numCharsToCheck = Math.Min(content.Length, maxCharsToCheck);
|
||||||
for (int i = 0; i < numCharsToCheck; ++i) {
|
int i = 0;
|
||||||
char c = fileText[i];
|
if (content.Length >= 3 && content[0] == 0xEF && content[1] == 0xBB && content[2] == 0xBF) // skip potential BOM
|
||||||
|
i = 3;
|
||||||
|
for (; i < numCharsToCheck; ++i) {
|
||||||
|
char c = (char)content[i];
|
||||||
if (char.IsWhiteSpace(c))
|
if (char.IsWhiteSpace(c))
|
||||||
continue;
|
continue;
|
||||||
return c == '{';
|
return c == '{';
|
||||||
|
|||||||
@ -192,7 +192,7 @@ namespace Spine {
|
|||||||
protected override void Draw (GameTime gameTime) {
|
protected override void Draw (GameTime gameTime) {
|
||||||
GraphicsDevice.Clear(Color.Black);
|
GraphicsDevice.Clear(Color.Black);
|
||||||
|
|
||||||
state.Update(gameTime.ElapsedGameTime.Milliseconds / 1000f);
|
state.Update((float)(gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0));
|
||||||
state.Apply(skeleton);
|
state.Apply(skeleton);
|
||||||
skeleton.UpdateWorldTransform();
|
skeleton.UpdateWorldTransform();
|
||||||
if (skeletonRenderer.Effect is BasicEffect) {
|
if (skeletonRenderer.Effect is BasicEffect) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user