From 906793db81afcdbb47475419ce304a3dc5d04ac6 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 2 Dec 2024 19:44:31 +0100 Subject: [PATCH] [unity] Exposed public SkeletonGraphic.SetScaledPivotOffset method outside of the editor. --- CHANGELOG.md | 1 + .../Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs | 4 ++-- spine-unity/Assets/Spine/package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c07bb22de..a3e75cabe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -165,6 +165,7 @@ - `SkeletonRootMotion` components now provide a public `Initialize()` method which is automatically called when calling `skeletonAnimation.Initialize(true)` to update the necessary skeleton references. If a different root bone shall be used, be sure to set `skeletonRootMotion.rootMotionBoneName` before calling `skeletonAnimation.Initialize(true)`. - Skeleton Mecanim: Added new `Mix Mode` `Match`. When selected, Spine animation weights are calculated to best match the provided Mecanim clip weights. This mix mode is recommended on any layer using blend tree nodes. - URP Shaders: Added `ZWrite` variant of outline shader `Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly ZWrite`. Suitable for e.g. depth of field (DoF) effect where writing to the depth buffer is required. Note that for DoF effect, `Render Queue` needs to be set to `Alpha Test`. + - SkeletonGraphic: Exposed `SetScaledPivotOffset` as public method outside of the editor to support programatically moving mesh offsets at runtime based on mesh bounds. - **Breaking changes** diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs index 9c88ff382..6b2e04285 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs @@ -1416,11 +1416,11 @@ namespace Spine.Unity { public Vector2 GetScaledPivotOffset () { return pivotOffset * GetLayoutScale(layoutScaleMode); } - +#endif public void SetScaledPivotOffset (Vector2 pivotOffsetScaled) { pivotOffset = pivotOffsetScaled / GetLayoutScale(layoutScaleMode); } -#endif + protected float GetLayoutScale (LayoutMode mode) { Vector2 currentSize = GetCurrentRectSize(); mode = GetEffectiveLayoutMode(mode); diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json index 2df96e0fb..a49f24804 100644 --- a/spine-unity/Assets/Spine/package.json +++ b/spine-unity/Assets/Spine/package.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.spine-unity", "displayName": "spine-unity Runtime", "description": "This plugin provides the spine-unity runtime core.", - "version": "4.2.91", + "version": "4.2.92", "unity": "2018.3", "author": { "name": "Esoteric Software",