Browse Source

[csharp] Port of commit e78095e: Gravity takes yDown in consideration.

Harald Csaszar 1 year ago
parent
commit
36a1a1742b
2 changed files with 3 additions and 3 deletions
  1. 2 2
      spine-csharp/src/PhysicsConstraint.cs
  2. 1 1
      spine-csharp/src/package.json

+ 2 - 2
spine-csharp/src/PhysicsConstraint.cs

@@ -170,7 +170,7 @@ namespace Spine {
 							uy = by;
 						}
 						if (a >= t) {
-							float m = massInverse * t, e = strength, w = wind * f, g = gravity * f;
+							float m = massInverse * t, e = strength, w = wind * f, g = (Bone.yDown ? -gravity : gravity) * f;
 							float d = (float)Math.Pow(damping, 60 * t);
 							do {
 								if (x) {
@@ -219,7 +219,7 @@ namespace Spine {
 						}
 						a = this.remaining;
 						if (a >= t) {
-							float m = massInverse * t, e = strength, w = wind, g = gravity;
+							float m = massInverse * t, e = strength, w = wind, g = (Bone.yDown ? -gravity : gravity);
 							float d = (float)Math.Pow(damping, 60 * t), h = l / f;
 							while (true) {
 								a -= t;

+ 1 - 1
spine-csharp/src/package.json

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