[unity] Physics Transform position changes: Fixed Z instead of Y axis affecting vertical translation (see commit 09e1436).

This commit is contained in:
Harald Csaszar 2024-01-22 17:52:28 +01:00
parent 11b339bd67
commit 900e92ba46
4 changed files with 7 additions and 7 deletions

View File

@ -244,10 +244,10 @@ namespace Spine.Unity {
skeleton.Update(deltaTime); skeleton.Update(deltaTime);
if (Application.isPlaying) { 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; Vector2 positionDelta = position - lastPosition;
positionDelta.x /= transform.lossyScale.x; positionDelta.x /= transform.lossyScale.x;
positionDelta.y /= transform.lossyScale.z; positionDelta.y /= transform.lossyScale.y;
skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y); skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y);
lastPosition = position; lastPosition = position;
} }

View File

@ -382,10 +382,10 @@ namespace Spine.Unity {
skeleton.Update(deltaTime); skeleton.Update(deltaTime);
if (Application.isPlaying) { 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; Vector2 positionDelta = (position - lastPosition) / meshScale;
positionDelta.x /= transform.lossyScale.x; positionDelta.x /= transform.lossyScale.x;
positionDelta.y /= transform.lossyScale.z; positionDelta.y /= transform.lossyScale.y;
skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y); skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y);
lastPosition = position; lastPosition = position;
} }

View File

@ -127,10 +127,10 @@ namespace Spine.Unity {
skeleton.Update(deltaTime); skeleton.Update(deltaTime);
if (Application.isPlaying) { 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; Vector2 positionDelta = position - lastPosition;
positionDelta.x /= transform.lossyScale.x; positionDelta.x /= transform.lossyScale.x;
positionDelta.y /= transform.lossyScale.z; positionDelta.y /= transform.lossyScale.y;
skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y); skeleton.PhysicsTranslate(positionDelta.x, positionDelta.y);
lastPosition = position; lastPosition = position;
} }

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.spine-unity", "name": "com.esotericsoftware.spine.spine-unity",
"displayName": "spine-unity Runtime", "displayName": "spine-unity Runtime",
"description": "This plugin provides the spine-unity runtime core.", "description": "This plugin provides the spine-unity runtime core.",
"version": "4.2.42", "version": "4.2.43",
"unity": "2018.3", "unity": "2018.3",
"author": { "author": {
"name": "Esoteric Software", "name": "Esoteric Software",