From 900e92ba46d801d9213189a3101163cb3b3b16bf Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 22 Jan 2024 17:52:28 +0100 Subject: [PATCH] [unity] Physics Transform position changes: Fixed Z instead of Y axis affecting vertical translation (see commit 09e1436). --- .../Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs | 4 ++-- .../Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs | 4 ++-- .../Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs | 4 ++-- spine-unity/Assets/Spine/package.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs index 390c2e694..b8268e5b4 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs @@ -244,10 +244,10 @@ namespace Spine.Unity { skeleton.Update(deltaTime); if (Application.isPlaying) { - Vector2 position = new Vector2(transform.position.x, transform.position.z); + Vector2 position = new Vector2(transform.position.x, transform.position.y); Vector2 positionDelta = position - lastPosition; positionDelta.x /= transform.lossyScale.x; - positionDelta.y /= transform.lossyScale.z; + positionDelta.y /= transform.lossyScale.y; skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y); lastPosition = position; } 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 aa51b5edc..826e4d62a 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs @@ -382,10 +382,10 @@ namespace Spine.Unity { skeleton.Update(deltaTime); if (Application.isPlaying) { - Vector2 position = new Vector2(transform.position.x, transform.position.z); + Vector2 position = new Vector2(transform.position.x, transform.position.y); Vector2 positionDelta = (position - lastPosition) / meshScale; positionDelta.x /= transform.lossyScale.x; - positionDelta.y /= transform.lossyScale.z; + positionDelta.y /= transform.lossyScale.y; skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y); lastPosition = position; } diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs index 677481f60..ac87f089f 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs @@ -127,10 +127,10 @@ namespace Spine.Unity { skeleton.Update(deltaTime); if (Application.isPlaying) { - Vector2 position = new Vector2(transform.position.x, transform.position.z); + Vector2 position = new Vector2(transform.position.x, transform.position.y); Vector2 positionDelta = position - lastPosition; positionDelta.x /= transform.lossyScale.x; - positionDelta.y /= transform.lossyScale.z; + positionDelta.y /= transform.lossyScale.y; skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y); lastPosition = position; } diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json index 3d5c8acfc..12f964eae 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.42", + "version": "4.2.43", "unity": "2018.3", "author": { "name": "Esoteric Software",