mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[unity] Fixed SkeletonRootMotion ignoring parent bone scale set via transform constraints. Closes #2580.
This commit is contained in:
parent
59bcffcf42
commit
3e8c9dfa66
@ -122,7 +122,7 @@
|
||||
|
||||
### Unity
|
||||
|
||||
- **Officially supported Unity versions are 2017.1-2022.1**.
|
||||
- **Officially supported Unity versions are 2017.1-2023.1**.
|
||||
|
||||
- **Additions**
|
||||
|
||||
@ -174,6 +174,7 @@
|
||||
- Inspector: String attribute `SpineSkin()` now allows to include `<None>` in the list of parameters. Previously the `includeNone=true` parameter of the `SpineSkin()` attribute defaulted to `true` but was ignored. Now it defaults to `false` and has an effect on the list. Only the Inspector GUI is affected by this behaviour change.
|
||||
- `SkeletonGraphicRenderTexture` example component: `protected RawImage quadRawImage` was changed to `protected SkeletonSubmeshGraphic quadMaskableGraphic` for a bugfix. This is only relevant for subclasses of `SkeletonGraphicRenderTexture` or when querying the `RawImage` component via e.g. `skeletonGraphicRenderTexture.quad.GetComponent<RawImage>()`.
|
||||
- Fixed a bug where when Linear color space is used and `PMA vertex colors` enabled, additive slots add a too dark (too transparent) color value. If you want the old incorrect behaviour (darker additive slots) or are not using Linear but Gamma color space, you can comment-out the define `LINEAR_COLOR_SPACE_FIX_ADDITIVE_ALPHA` in `MeshGenerator.cs` to deactivate the fix or just to skip unnecessary instructions.
|
||||
- Fixed SkeletonRootMotion components ignoring parent bone scale when set by transform constraints. Using applied scale of parent bone now. If you need the old behaviour, comment out the line `#define USE_APPLIED_PARENT_SCALE` in SkeletonRootMotionBase.cs.
|
||||
|
||||
- **Changes of default values**
|
||||
|
||||
|
||||
@ -27,6 +27,12 @@
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
// In order to respect TransformConstraints modifying the scale of parent bones,
|
||||
// GetScaleAffectingRootMotion() now uses parentBone.AScaleX and AScaleY instead
|
||||
// of previously used ScaleX and ScaleY. If you require the previous behaviour,
|
||||
// comment out the define below.
|
||||
#define USE_APPLIED_PARENT_SCALE
|
||||
|
||||
using Spine.Unity.AnimationTools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -641,8 +647,13 @@ namespace Spine.Unity {
|
||||
parentBoneScale = Vector2.one;
|
||||
Bone scaleBone = rootMotionBone;
|
||||
while ((scaleBone = scaleBone.Parent) != null) {
|
||||
#if USE_APPLIED_PARENT_SCALE
|
||||
parentBoneScale.x *= scaleBone.AScaleX;
|
||||
parentBoneScale.y *= scaleBone.AScaleY;
|
||||
#else
|
||||
parentBoneScale.x *= scaleBone.ScaleX;
|
||||
parentBoneScale.y *= scaleBone.ScaleY;
|
||||
#endif
|
||||
}
|
||||
totalScale = Vector2.Scale(totalScale, parentBoneScale);
|
||||
totalScale *= AdditionalScale;
|
||||
|
||||
@ -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.77",
|
||||
"version": "4.2.78",
|
||||
"unity": "2018.3",
|
||||
"author": {
|
||||
"name": "Esoteric Software",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user