As Spine 4.1 has just been released, you can find the officially compiled Upgrade Guide for version 4.1 below.
Re-exporting skeletons and upgrading the spine-unity runtime files
Please check out the spine-unity documentation sections below:
spine-unity Runtime Documentation: Updating the spine unity Runtime
spine-unity Runtime Documentation: Updating an Extension UPM Package
They describe necessary steps like re-exporting your skeletons, upgrading across multiple spine-unity versions and how to safely upgrade the spine-unity runtime files.
Adapting your code to 4.1 API changes
For notable changes to the API, please see the Changelog, sections C#
and Unity
https://github.com/EsotericSoftware/spine-runtimes/blob/4.1/CHANGELOG.md#c-2
Some methods have been renamed or replaced in 4.1.
If you receive compile errors from your own code because of using renamed and no-longer existing methods, the following points from the changelog will help to perform the required steps to your own code to make it compatible again:
-
Made SkeletonGraphic.unscaledTime
parameter protected. Use the new property UnscaledTime
instead.
-
Removed AttachmentRegionExtensions
methods Attachment.SetRegion
, MeshAttachment.SetRegion
and RegionAttachment.SetRegion(region, update)
.
Use attachment.Region = region; if (update) attachment.UpdateRegion()
instead.
The following list covers breaking changes to inner parts, which users typically do not access. Most likely these were never used in user code, so no changes should be necessary.
-
Removed IHasRendererObject
interface. Use IHasTextureRegion
instead.
-
Removed RendererObject
property from RegionAttachment and MeshAttachment. Use attachment.Region
property instead.
-
Replaced RegionAttachment.UpdateOffset
and MeshAttachment.UpdateUVs
with Attachment.UpdateRegion
. The caller must ensure that the attachment's region is not null
.
-
AttachmentLoader.NewRegionAttachment()
and AttachmentLoader.NewMeshAttachment()
take an additional Sequence
parameter.
-
VertexAttachment.DeformAttachment
property has been replaced with VertexAttachment.TimelineAttachment
.
-
RegionAttachment.ComputeWorldVertices()
takes a Slot instead of a Bone as the first argument.
-
Removed Skeleton.Update(float deltaTime)
method. Remove any occurrance of this call, it is no longer necessary.
-
Removed Slot.AttachmentTime
property. Remove any occurrance from your code.
-
Removed extension method AtlasRegion.GetSpineAtlasRect()
parameter includeRotate
(with default value true
). Most likely this method was never used with includeRotate=false
in user code.
-
AtlasRegion.PackedWidth
and AtlasRegion.PackedHeight
are swapped compared to 4.0 when packing rotation is equal to 90 degrees.
Changes in behaviour from 4.0 to 4.1
For a full list of changes in behaviour, please again see the Changelog, sections C#
and Unity
https://github.com/EsotericSoftware/spine-runtimes/blob/4.1/CHANGELOG.md#c-2
-
SkeletonGraphic
OnRebuild
callback delegate is now issued after the skeleton has been initialized, before the AnimationState component is initialized. This makes behaviour consistent with SkeletonAnimation
and SkeletonMecanim
component behaviour. Use the new callback OnAnimationRebuild
if you want to receive a callback after the SkeletonGraphic
AnimationState has been initialized.
You can download the new unitypackages from the download page: spine-unity Download
If you find anything that should be noted or added to the guide, please do not hesitate to post it below so that we can make upgrading as easy and painless as possible for everyone.
We hope that you like the new Spine release and are able to create even more incredible games with it! 🙂