• Editor
  • Unity runtime doesn't work with dragon example

Related Discussions
...

I'm playing around with the Unity runtime and it works fine for Spineboy, the goblin and the powerup examples when I export them as JSON from Spine and generate an atlas using Texturepacker in LibGDX format.

For some reason the dragon example doesn't work in Unity though. There's no error message, it just shows up completely garbled, as if it reading the wrong areas from the texture atlas:

When I play the animation in Unity the movement looks similar to what I see in Spine, except for the wrong textures.

I'm using the same Texturepacker settings as I did for the other examples, so I'm not sure what the problem could be that's specific to the dragon?

This happened to me before the latest updates in the runtime. It had problems with rotated textures in the atlas. Did you get the latest one?

Yep, got the latest runtimes as of 3 hours ago.

I've also tried with rotated textures disabled in the Texturepacker settings: The result is different in Unity, but no less broken than what's in the screenshot above.

I took a look. It works in the XNA runtime, so it isn't a problem with spine-csharp. The biggest difference with the dragon is that it is huge. The regions don't fit on a single 1024x1024 atlas. The Spine runtime for Unity can only handle atlases with a single backing image, so you'll need to pack the dragon into a larger image. Getting rid of the template and logo images helps. Then in Unity, click the image and look at the inspector:

图像因不支持 HTTPS 被隐藏。 | 仍然显示

The max size must be large enough, else it seems Unity scales the image down. I found that I had to restart Unity after changing the max size. If the resolution shown at the bottom of the inspector doesn't match the actual image resolution, Unity is scaling the image. Once I had that set right (and restarted Unity), it works:

图像因不支持 HTTPS 被隐藏。 | 仍然显示

Dragon files I used are attached.

Thanks for looking into it, Nate! I can confirm your solution works.

By the way, just hitting "play" seems to be enough to get the resolution change to stick. No need to restart Unity.