diff --git a/org.mixedrealitytoolkit.core/Editor/Utilities/InspectorUIUtility.cs b/org.mixedrealitytoolkit.core/Editor/Utilities/InspectorUIUtility.cs index 26055d3c1..09bbc81da 100644 --- a/org.mixedrealitytoolkit.core/Editor/Utilities/InspectorUIUtility.cs +++ b/org.mixedrealitytoolkit.core/Editor/Utilities/InspectorUIUtility.cs @@ -357,10 +357,9 @@ public static bool RenderIndentedButton(GUIContent content, GUIStyle style, para /// if button clicked, if otherwise. public static bool RenderIndentedButton(Func renderButton) { - bool result = false; GUILayout.BeginHorizontal(); GUILayout.Space(EditorGUI.indentLevel * 15); - result = renderButton(); + bool result = renderButton(); GUILayout.EndHorizontal(); return result; } @@ -951,11 +950,7 @@ public static float AxisMoveHandle(Object target, Vector3 origin, Vector3 direct Handles.DrawDottedLine(origin, position, DottedLineScreenSpace); Handles.ArrowHandleCap(0, position, Quaternion.LookRotation(direction), handleSize * 2, EventType.Repaint); -#if UNITY_2022_1_OR_NEWER Vector3 newPosition = Handles.FreeMoveHandle(position, handleSize, Vector3.zero, Handles.CircleHandleCap); -#else - Vector3 newPosition = Handles.FreeMoveHandle(position, Quaternion.identity, handleSize, Vector3.zero, Handles.CircleHandleCap); -#endif if (recordUndo) { @@ -992,11 +987,7 @@ public static Vector3 CircleMoveHandle(Object target, Vector3 position, float xS handleSize = Mathf.Lerp(handleSize, HandleUtility.GetHandleSize(position) * handleSize, 0.75f); } -#if UNITY_2022_1_OR_NEWER Vector3 newPosition = Handles.FreeMoveHandle(position, handleSize, Vector3.zero, Handles.CircleHandleCap); -#else - Vector3 newPosition = Handles.FreeMoveHandle(position, Quaternion.identity, handleSize, Vector3.zero, Handles.CircleHandleCap); -#endif if (recordUndo && position != newPosition) { @@ -1032,11 +1023,7 @@ public static Vector3 SquareMoveHandle(Object target, Vector3 position, float xS } // Multiply square handle to match other types -#if UNITY_2022_1_OR_NEWER Vector3 newPosition = Handles.FreeMoveHandle(position, handleSize * 0.8f, Vector3.zero, Handles.RectangleHandleCap); -#else - Vector3 newPosition = Handles.FreeMoveHandle(position, Quaternion.identity, handleSize * 0.8f, Vector3.zero, Handles.RectangleHandleCap); -#endif if (recordUndo && position != newPosition) { @@ -1072,11 +1059,7 @@ public static Vector3 SphereMoveHandle(Object target, Vector3 position, float xS } // Multiply sphere handle size to match other types -#if UNITY_2022_1_OR_NEWER Vector3 newPosition = Handles.FreeMoveHandle(position, handleSize * 2, Vector3.zero, Handles.SphereHandleCap); -#else - Vector3 newPosition = Handles.FreeMoveHandle(position, Quaternion.identity, handleSize * 2, Vector3.zero, Handles.SphereHandleCap); -#endif if (recordUndo && position != newPosition) { @@ -1146,12 +1129,7 @@ public static Vector3 VectorHandle( // Draw a line from origin to origin + direction Handles.DrawLine(origin, handlePosition); - -#if UNITY_2022_1_OR_NEWER Vector3 newPosition = Handles.FreeMoveHandle(handlePosition, handleSize, Vector3.zero, Handles.DotHandleCap); -#else - Vector3 newPosition = Handles.FreeMoveHandle(handlePosition, Quaternion.identity, handleSize, Vector3.zero, Handles.DotHandleCap); -#endif if (recordUndo && handlePosition != newPosition) { diff --git a/org.mixedrealitytoolkit.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs b/org.mixedrealitytoolkit.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs index ea8889c10..80505eac0 100644 --- a/org.mixedrealitytoolkit.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs +++ b/org.mixedrealitytoolkit.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs @@ -195,11 +195,7 @@ private float DrawPlaneAndHandle(Vector3[] vertices, Vector2 halfExtents, float Handles.ArrowHandleCap(0, vertices[1], Quaternion.LookRotation(planeNormal), handleSize * 2, EventType.Repaint); Handles.ArrowHandleCap(0, vertices[1], Quaternion.LookRotation(-planeNormal), handleSize * 2, EventType.Repaint); -#if UNITY_2022_1_OR_NEWER Vector3 newPosition = Handles.FreeMoveHandle(vertices[1], handleSize, Vector3.zero, Handles.SphereHandleCap); -#else - Vector3 newPosition = Handles.FreeMoveHandle(vertices[1], Quaternion.identity, handleSize, Vector3.zero, Handles.SphereHandleCap); -#endif if (!newPosition.Equals(vertices[1])) { diff --git a/org.mixedrealitytoolkit.uxcore/Editor/Inspectors/Slider/SliderInspector.cs b/org.mixedrealitytoolkit.uxcore/Editor/Inspectors/Slider/SliderInspector.cs index 97162249a..169da2c2e 100644 --- a/org.mixedrealitytoolkit.uxcore/Editor/Inspectors/Slider/SliderInspector.cs +++ b/org.mixedrealitytoolkit.uxcore/Editor/Inspectors/Slider/SliderInspector.cs @@ -69,31 +69,15 @@ private void OnSceneGUI() EditorGUI.BeginChangeCheck(); -#if UNITY_2022_1_OR_NEWER Vector3 newStartPosition = Handles.FreeMoveHandle(startPos, handleSize, Vector3.zero, Handles.SphereHandleCap); -#else - Vector3 newStartPosition = Handles.FreeMoveHandle(startPos, - Quaternion.identity, - handleSize, - Vector3.zero, - Handles.SphereHandleCap); -#endif -#if UNITY_2022_1_OR_NEWER - Vector3 newEndPosition = Handles.FreeMoveHandle(endPos, - handleSize, - Vector3.zero, - Handles.SphereHandleCap); -#else Vector3 newEndPosition = Handles.FreeMoveHandle(endPos, - Quaternion.identity, handleSize, Vector3.zero, Handles.SphereHandleCap); -#endif if (EditorGUI.EndChangeCheck()) {