mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[unity] Fixed BoneFollower MissingReferenceException when skeleton is destroyed. Closes #2903.
This commit is contained in:
parent
8ddb2d8d0c
commit
659e043f1b
@ -171,8 +171,9 @@ namespace Spine.Unity {
|
||||
q.w = Mathf.Cos(halfRotation);
|
||||
thisTransform.localRotation = q;
|
||||
}
|
||||
} else {
|
||||
// For special cases: Use transform world properties if transform relationship is complicated
|
||||
} else { // For special cases: Use transform world properties if transform relationship is complicated
|
||||
if (!skeletonTransform) return;
|
||||
|
||||
Vector3 targetWorldPosition = skeletonTransform.TransformPoint(new Vector3(bone.WorldX, bone.WorldY, 0f));
|
||||
if (!followZPosition) targetWorldPosition.z = thisTransform.position.z;
|
||||
if (!followXYPosition) {
|
||||
|
||||
@ -149,8 +149,9 @@ namespace Spine.Unity {
|
||||
followXYPosition ? bone.WorldY * scale + offset.y : thisTransform.localPosition.y,
|
||||
followZPosition ? 0f : thisTransform.localPosition.z);
|
||||
if (followBoneRotation) thisTransform.localRotation = bone.GetQuaternion();
|
||||
} else {
|
||||
// For special cases: Use transform world properties if transform relationship is complicated
|
||||
} else { // For special cases: Use transform world properties if transform relationship is complicated
|
||||
if (!skeletonTransform) return;
|
||||
|
||||
Vector3 targetWorldPosition = skeletonTransform.TransformPoint(
|
||||
new Vector3(bone.WorldX * scale + offset.x, bone.WorldY * scale + offset.y, 0f));
|
||||
if (!followZPosition) targetWorldPosition.z = thisTransform.position.z;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user