|
@@ -71,6 +71,7 @@ namespace Spine.Unity.Examples {
|
|
public int colliderLayer = 0;
|
|
public int colliderLayer = 0;
|
|
[Range(0, 1)]
|
|
[Range(0, 1)]
|
|
public float mix = 1;
|
|
public float mix = 1;
|
|
|
|
+ public bool oldRagdollBehaviour = true;
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
ISkeletonAnimation targetSkeletonComponent;
|
|
ISkeletonAnimation targetSkeletonComponent;
|
|
@@ -338,6 +339,13 @@ namespace Spine.Unity.Examples {
|
|
var t = pair.Value;
|
|
var t = pair.Value;
|
|
bool isStartingBone = (b == startingBone);
|
|
bool isStartingBone = (b == startingBone);
|
|
Transform parentTransform = isStartingBone ? ragdollRoot : boneTable[b.Parent];
|
|
Transform parentTransform = isStartingBone ? ragdollRoot : boneTable[b.Parent];
|
|
|
|
+ if (!oldRagdollBehaviour && isStartingBone) {
|
|
|
|
+ if (b != skeleton.RootBone) { // RagdollRoot is not skeleton root.
|
|
|
|
+ ragdollRoot.localPosition = new Vector3(b.Parent.WorldX, b.Parent.WorldY, 0);
|
|
|
|
+ ragdollRoot.localRotation = Quaternion.Euler(0, 0, GetPropagatedRotation(b.Parent));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
Vector3 parentTransformWorldPosition = parentTransform.position;
|
|
Vector3 parentTransformWorldPosition = parentTransform.position;
|
|
Quaternion parentTransformWorldRotation = parentTransform.rotation;
|
|
Quaternion parentTransformWorldRotation = parentTransform.rotation;
|
|
|
|
|