From 9cc2fa6a2b3c9afa8d5e5efb458140fece10d172 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 8 Jun 2017 01:09:01 +0800 Subject: [PATCH] [unity] Handle obsolete DotCap call. --- .../spine-unity/Editor/SpineEditorUtilities.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs index 1ff346f54..32cf97d05 100644 --- a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs +++ b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs @@ -1675,13 +1675,21 @@ namespace Spine.Unity.Editor { const float endCapSize = 0.05f; Vector3 firstPoint = m.MultiplyPoint(new Vector3(pv[2], pv[3])); - Handles.DotCap(0, firstPoint, Quaternion.identity, endCapSize * HandleUtility.GetHandleSize(firstPoint)); - // if (!p.Closed) Handles.DotCap(0, m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])), q, endCapSize); + SpineHandles.DrawDot(firstPoint, endCapSize); + //if (!p.Closed) SpineHandles.DrawDot(m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])), endCapSize); if (includeName) Handles.Label(firstPoint + new Vector3(0,0.1f), p.Name, PathNameStyle); Handles.color = ocolor; } + public static void DrawDot (Vector3 position, float size) { + #if UNITY_5_6_OR_NEWER + Handles.DotHandleCap(0, position, Quaternion.identity, size * HandleUtility.GetHandleSize(position), EventType.Ignore); + #else + Handles.DotCap(0, position, Quaternion.identity, size * HandleUtility.GetHandleSize(position)); + #endif + } + public static void DrawBoundingBoxes (Transform transform, Skeleton skeleton) { foreach (var slot in skeleton.Slots) { var bba = slot.Attachment as BoundingBoxAttachment;