mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
spine-unity
The spine-unity runtime provides functionality to load, manipulate and render Spine skeletal animation data using Unity directly, without any other plugins. spine-unity is based on spine-csharp and is very similar to spine-tk2d.
A Spine skeleton is a GameObject and can be used throughout Unity like any other GameObject. The BoneComponent class allows other GameObjects to follow a bone in a Spine skeleton.
Setup
- Download the Spine Runtimes source using git or by downloading it as a zip.
- Copy the contents of
spine-csharp/srctospine-unity/Assets/Spine/spine-csharp. - Open the
spine-unity/Assets/examples/spineboy/spineboy.unityscene file using Unity 4.2+.
Notes
- Atlas images should use premultiplied alpha when using the shaders that come with spine-unity.
- This slightly outdated spine-unity tutorial video may still be useful.
- Unity scales large images down by default if they exceed 1024x1024, which causes atlas coordinates to be incorrect. To fix this, override the import settings in the Inspector for any large atlas image you have so Unity does not scale it down.
- Unity 4.3+'s 2D project defaults cause atlas images added to the project to be imported with the Texture Type "Sprite", which may cause artifacts when using Spine's Skeleton shader. To avoid these artifacts, make sure the Texture Type is set to "Texture".