From 68ef65eee02d1ae0f4abbf00aaa3be7d30a2d9e8 Mon Sep 17 00:00:00 2001 From: pharan Date: Mon, 10 Dec 2018 02:28:52 +0800 Subject: [PATCH] [unity] Rename extension to SetLocalPosition --- .../Spine/Runtime/spine-unity/SkeletonExtensions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs index bd4286a51..742b009b1 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs @@ -121,13 +121,13 @@ namespace Spine.Unity { #region Bone /// Sets the bone's (local) X and Y according to a Vector2 - public static void SetPosition (this Bone bone, Vector2 position) { + public static void SetLocalPosition (this Bone bone, Vector2 position) { bone.X = position.x; bone.Y = position.y; } /// Sets the bone's (local) X and Y according to a Vector3. The z component is ignored. - public static void SetPosition (this Bone bone, Vector3 position) { + public static void SetLocalPosition (this Bone bone, Vector3 position) { bone.X = position.x; bone.Y = position.y; } @@ -196,12 +196,12 @@ namespace Spine.Unity { /// The local position in its parent bone space, or in skeleton space if it is the root bone. public static Vector2 SetPositionSkeletonSpace (this Bone bone, Vector2 skeletonSpacePosition) { if (bone.parent == null) { // root bone - bone.SetPosition(skeletonSpacePosition); + bone.SetLocalPosition(skeletonSpacePosition); return skeletonSpacePosition; } else { var parent = bone.parent; Vector2 parentLocal = parent.WorldToLocal(skeletonSpacePosition); - bone.SetPosition(parentLocal); + bone.SetLocalPosition(parentLocal); return parentLocal; } }