From ba129b7b900f09619981ef8a616bb3a798b95813 Mon Sep 17 00:00:00 2001 From: Dennis Lieu Date: Fri, 20 Apr 2018 02:14:33 +0200 Subject: [PATCH] [unity] Use public properties in examples. * Use public Rotation property instead of internal rotation field in code example to allow Spine to be imported in Plugins folder * Use public Attachment property instead of internal attachment field to allow Spine to be imported in Plugins folder --- .../Assets/Spine Examples/Scripts/SpineboyBodyTilt.cs | 6 +++--- .../Spine Examples/Scripts/SpineboyFacialExpression.cs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spine-unity/Assets/Spine Examples/Scripts/SpineboyBodyTilt.cs b/spine-unity/Assets/Spine Examples/Scripts/SpineboyBodyTilt.cs index 82c984ea2..878d5dfcb 100644 --- a/spine-unity/Assets/Spine Examples/Scripts/SpineboyBodyTilt.cs +++ b/spine-unity/Assets/Spine Examples/Scripts/SpineboyBodyTilt.cs @@ -27,7 +27,7 @@ namespace Spine.Unity.Examples { hipBone = skeleton.FindBone(hip); headBone = skeleton.FindBone(head); - baseHeadRotation = headBone.rotation; + baseHeadRotation = headBone.Rotation; skeletonAnimation.UpdateLocal += UpdateLocal; } @@ -35,8 +35,8 @@ namespace Spine.Unity.Examples { private void UpdateLocal (ISkeletonAnimation animated) { hipRotationTarget = planter.Balance * hipTiltScale; hipRotationSmoothed = Mathf.MoveTowards(hipRotationSmoothed, hipRotationTarget, Time.deltaTime * hipRotationMoveScale * Mathf.Abs(2f * planter.Balance / planter.offBalanceThreshold)); - hipBone.rotation = hipRotationSmoothed; - headBone.rotation = baseHeadRotation + (-hipRotationSmoothed * headTiltScale); + hipBone.Rotation = hipRotationSmoothed; + headBone.Rotation = baseHeadRotation + (-hipRotationSmoothed * headTiltScale); } } diff --git a/spine-unity/Assets/Spine Examples/Scripts/SpineboyFacialExpression.cs b/spine-unity/Assets/Spine Examples/Scripts/SpineboyFacialExpression.cs index 6a0ed3fd6..48b2b7dc0 100644 --- a/spine-unity/Assets/Spine Examples/Scripts/SpineboyFacialExpression.cs +++ b/spine-unity/Assets/Spine Examples/Scripts/SpineboyFacialExpression.cs @@ -48,11 +48,11 @@ namespace Spine.Unity.Examples { shockTimer -= Time.deltaTime; if (shockTimer > 0) { - eyeSlot.attachment = shockEye; - mouthSlot.attachment = shockMouth; + eyeSlot.Attachment = shockEye; + mouthSlot.Attachment = shockMouth; } else { - eyeSlot.attachment = normalEye; - mouthSlot.attachment = normalMouth; + eyeSlot.Attachment = normalEye; + mouthSlot.Attachment = normalMouth; } } }