The Galacean editor has built-in support for Spine animations, requiring no additional downloads or configurations, making the development process significantly easier. This chapter introduces how to use Spine animations in the Galacean editor.
For editor version dependencies, please refer to: Version/Performance Section
The first step is to export your Spine animation assets from the Spine editor. You can find the complete steps in the "Spine User Guide", which explains how to:
Below is a brief overview of the Spine asset export process:
Spine Menu
> Export
to open the export window.The packing settings refer to the texture packing configurations. Refer to the official documentation for detailed parameters. After completing the packing settings, click OK.
The second step is to import the files exported from the Spine editor into the Galacean editor.
After opening the editor, drag the exported files directly into the Assets Panel to upload them, as shown in the following GIF:
You can also click the upload button in the assets panel and select the files to upload:
Once uploaded, you will see the uploaded Spine assets in the assets panel, including: SpineSkeletonData assets, SpineAtlas assets, and texture assets.
The SpineSkeletonData asset stores skeleton data and references to the generated SpineAtlas asset. By clicking the asset, you can preview the Spine animation in the inspector, where you can switch between Skin
and Animation Clips
in the preview panel:
The SpineAtlas asset stores the texture atlas file and contains references to the required texture assets. By clicking the asset, you can view its referenced texture assets and atlas information in the inspector.
If you need to update your Spine assets, re-export the assets from the Spine editor and import them into the Galacean editor to overwrite the existing files.
After uploading the assets, you can add Spine animations to the scene using the following three methods:
Drag-and-drop is the quickest method. Click the SpineSkeletonData asset, hold and drag it into the viewport to quickly create an entity with the SpineAnimationRenderer component and specify the selected SpineSkeletonData asset.
Click the quick add button in the upper left corner and select 2D Object
> SpineAnimationRenderer
.
After adding, you will see a new entity with the SpineAnimationRenderer component. Click the Resource property and select the uploaded SpineSkeletonData asset to see the Spine animation.
The manual method is similar to quick add but requires manually creating a new entity in the node tree and adding the SpineAnimationRenderer component via the AddComponent button in the inspector.
After adding the SpineAnimationRenderer component, you also need to specify the component's Resource, which is the SpineSkeletonData asset that the SpineAnimationRenderer component will render.
All three methods for adding Spine animations are essentially the same: by adding the SpineAnimationRenderer component to an entity to incorporate Spine animations into the scene.
The SpineAnimationRenderer component configuration is as follows:
Using the SpineAnimationRenderer component, you can configure the Spine animation assets and default states:
Finally, after completing scene editing, you can refer to the Project Export process to export the editor project.
Next section: Using Galacean Spine Runtime in Your Code
Next Chapter: Using in Code