Skip to content

Commit f50d8b3

Browse files
committed
Remove a few #if UNITY_2022_1_OR_NEWER
1 parent 5fe28ac commit f50d8b3

File tree

3 files changed

+1
-43
lines changed

3 files changed

+1
-43
lines changed

org.mixedrealitytoolkit.core/Editor/Utilities/InspectorUIUtility.cs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,9 @@ public static bool RenderIndentedButton(GUIContent content, GUIStyle style, para
357357
/// <returns><see langword="true"/> if button clicked, <see langword="false"/> if otherwise.</returns>
358358
public static bool RenderIndentedButton(Func<bool> renderButton)
359359
{
360-
bool result = false;
361360
GUILayout.BeginHorizontal();
362361
GUILayout.Space(EditorGUI.indentLevel * 15);
363-
result = renderButton();
362+
bool result = renderButton();
364363
GUILayout.EndHorizontal();
365364
return result;
366365
}
@@ -951,11 +950,7 @@ public static float AxisMoveHandle(Object target, Vector3 origin, Vector3 direct
951950

952951
Handles.DrawDottedLine(origin, position, DottedLineScreenSpace);
953952
Handles.ArrowHandleCap(0, position, Quaternion.LookRotation(direction), handleSize * 2, EventType.Repaint);
954-
#if UNITY_2022_1_OR_NEWER
955953
Vector3 newPosition = Handles.FreeMoveHandle(position, handleSize, Vector3.zero, Handles.CircleHandleCap);
956-
#else
957-
Vector3 newPosition = Handles.FreeMoveHandle(position, Quaternion.identity, handleSize, Vector3.zero, Handles.CircleHandleCap);
958-
#endif
959954

960955
if (recordUndo)
961956
{
@@ -992,11 +987,7 @@ public static Vector3 CircleMoveHandle(Object target, Vector3 position, float xS
992987
handleSize = Mathf.Lerp(handleSize, HandleUtility.GetHandleSize(position) * handleSize, 0.75f);
993988
}
994989

995-
#if UNITY_2022_1_OR_NEWER
996990
Vector3 newPosition = Handles.FreeMoveHandle(position, handleSize, Vector3.zero, Handles.CircleHandleCap);
997-
#else
998-
Vector3 newPosition = Handles.FreeMoveHandle(position, Quaternion.identity, handleSize, Vector3.zero, Handles.CircleHandleCap);
999-
#endif
1000991

1001992
if (recordUndo && position != newPosition)
1002993
{
@@ -1032,11 +1023,7 @@ public static Vector3 SquareMoveHandle(Object target, Vector3 position, float xS
10321023
}
10331024

10341025
// Multiply square handle to match other types
1035-
#if UNITY_2022_1_OR_NEWER
10361026
Vector3 newPosition = Handles.FreeMoveHandle(position, handleSize * 0.8f, Vector3.zero, Handles.RectangleHandleCap);
1037-
#else
1038-
Vector3 newPosition = Handles.FreeMoveHandle(position, Quaternion.identity, handleSize * 0.8f, Vector3.zero, Handles.RectangleHandleCap);
1039-
#endif
10401027

10411028
if (recordUndo && position != newPosition)
10421029
{
@@ -1072,11 +1059,7 @@ public static Vector3 SphereMoveHandle(Object target, Vector3 position, float xS
10721059
}
10731060

10741061
// Multiply sphere handle size to match other types
1075-
#if UNITY_2022_1_OR_NEWER
10761062
Vector3 newPosition = Handles.FreeMoveHandle(position, handleSize * 2, Vector3.zero, Handles.SphereHandleCap);
1077-
#else
1078-
Vector3 newPosition = Handles.FreeMoveHandle(position, Quaternion.identity, handleSize * 2, Vector3.zero, Handles.SphereHandleCap);
1079-
#endif
10801063

10811064
if (recordUndo && position != newPosition)
10821065
{
@@ -1146,12 +1129,7 @@ public static Vector3 VectorHandle(
11461129

11471130
// Draw a line from origin to origin + direction
11481131
Handles.DrawLine(origin, handlePosition);
1149-
1150-
#if UNITY_2022_1_OR_NEWER
11511132
Vector3 newPosition = Handles.FreeMoveHandle(handlePosition, handleSize, Vector3.zero, Handles.DotHandleCap);
1152-
#else
1153-
Vector3 newPosition = Handles.FreeMoveHandle(handlePosition, Quaternion.identity, handleSize, Vector3.zero, Handles.DotHandleCap);
1154-
#endif
11551133

11561134
if (recordUndo && handlePosition != newPosition)
11571135
{

org.mixedrealitytoolkit.uxcore/Editor/Inspectors/PressableButton/PressableButtonInspector.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,7 @@ private float DrawPlaneAndHandle(Vector3[] vertices, Vector2 halfExtents, float
195195
Handles.ArrowHandleCap(0, vertices[1], Quaternion.LookRotation(planeNormal), handleSize * 2, EventType.Repaint);
196196
Handles.ArrowHandleCap(0, vertices[1], Quaternion.LookRotation(-planeNormal), handleSize * 2, EventType.Repaint);
197197

198-
#if UNITY_2022_1_OR_NEWER
199198
Vector3 newPosition = Handles.FreeMoveHandle(vertices[1], handleSize, Vector3.zero, Handles.SphereHandleCap);
200-
#else
201-
Vector3 newPosition = Handles.FreeMoveHandle(vertices[1], Quaternion.identity, handleSize, Vector3.zero, Handles.SphereHandleCap);
202-
#endif
203199

204200
if (!newPosition.Equals(vertices[1]))
205201
{

org.mixedrealitytoolkit.uxcore/Editor/Inspectors/Slider/SliderInspector.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,31 +69,15 @@ private void OnSceneGUI()
6969

7070
EditorGUI.BeginChangeCheck();
7171

72-
#if UNITY_2022_1_OR_NEWER
7372
Vector3 newStartPosition = Handles.FreeMoveHandle(startPos,
7473
handleSize,
7574
Vector3.zero,
7675
Handles.SphereHandleCap);
77-
#else
78-
Vector3 newStartPosition = Handles.FreeMoveHandle(startPos,
79-
Quaternion.identity,
80-
handleSize,
81-
Vector3.zero,
82-
Handles.SphereHandleCap);
83-
#endif
8476

85-
#if UNITY_2022_1_OR_NEWER
86-
Vector3 newEndPosition = Handles.FreeMoveHandle(endPos,
87-
handleSize,
88-
Vector3.zero,
89-
Handles.SphereHandleCap);
90-
#else
9177
Vector3 newEndPosition = Handles.FreeMoveHandle(endPos,
92-
Quaternion.identity,
9378
handleSize,
9479
Vector3.zero,
9580
Handles.SphereHandleCap);
96-
#endif
9781

9882
if (EditorGUI.EndChangeCheck())
9983
{

0 commit comments

Comments
 (0)