I have successfully imported files into Unity, there is no bug warning in console.
As you can see, the SkeletonData is blank.
Nothing in the Preview window, and nothing happened when I apply it to spine SkeletonAnimation as well.
I find the sample assets works fine in my Unity Program, so I guess the Unity plugin and UPM installed well.
I'm not sure what is wrong of my own spine file.
Blank SkeletonData
It seems like your issue might be related to the export settings or the compatibility between the Spine editor version and the spine-unity runtime version. Here are a few steps you can follow to troubleshoot and potentially resolve the issue:
Check Version Compatibility: Ensure that the version of the Spine editor you used to export the skeleton data matches the version of the spine-unity runtime you have installed. Mismatched versions can cause import issues. You can check the version in
Assets/Spine/version.txt
in your Unity project.Export Settings: Verify that your export settings in Spine are correct. Make sure you are exporting the skeleton data in the correct format (
.json
or.skel.bytes
) and that the atlas file has the correct extension (.atlas.txt
).Ignore Blank Images: If you have enabled the "Ignore blank images" option in the texture packer settings, it might cause issues if your skeleton relies on those images. Disable this option and re-export your project.
Re-import Assets: Sometimes, re-importing the assets can resolve issues. Delete the existing imported assets in Unity and re-import the parent directory containing your exported Spine files.
Check Console for Errors: Even though you mentioned there are no bug warnings in the console, double-check for any subtle warnings or messages that might give a clue about what went wrong.
Preview in Spine: Before importing into Unity, ensure that the skeleton's animations play correctly in the Spine editor. If they do not, there might be an issue with the Spine project itself.
Sample Assets: Since the sample assets work fine, compare their export settings and structure with your own Spine files to identify any discrepancies.
If the problem persists, you might want to try exporting your skeleton data in binary format (.skel.bytes
) instead of JSON, as this can sometimes bypass issues related to JSON parsing.
Levin I'm glad to hear that you are now able to see the preview!
To see the skin in the Scene window, set the skin in the Initial Skin
of the component that you selected when you added the skeleton to a GameObject, e.g. SkeletonAnimation
.
If you want to change the skin while it is running, you will need to do so from the code. For information on how to set the skin from the code, please see the spine-unity runtime documentation.
https://esotericsoftware.com/spine-unity-main-components#Setting-Skins
Levin To do this, we recommend that you first take a look at the 4 Object Oriented Sample
in the sample scenes. It demonstrates how to override the position of the crosshair
bone in Spineboy. Spineboy is set up with some IK constraints to point in the direction of the crosshair
bone while the target animation is playing. Check out the example script SpineboyTargetController.cs
that is attached to the VIEW Spineboy
in the scene.
Also, take a look at this page, which explains the setup of Spineboy itself:
Spineboy example - Aiming