Skip to content

Commit 8769d61

Browse files
committed
Merge pull request #10274 from keveleigh/enumvalueindex
Convert incorrect usages of enumValueIndex to intValue
1 parent 6ecbcde commit 8769d61

18 files changed

+33
-40
lines changed

Assets/MRTK/Core/Inspectors/ControllerPopupWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ private void RenderInteractionList(SerializedProperty interactionList, bool useC
502502
{
503503
var inputAction = actionId.intValue == 0 ? MixedRealityInputAction.None : MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile.InputActions[actionId.intValue - 1];
504504
actionDescription.stringValue = inputAction.Description;
505-
actionConstraint.enumValueIndex = (int)inputAction.AxisConstraint;
505+
actionConstraint.intValue = (int)inputAction.AxisConstraint;
506506
}
507507

508508
if ((AxisType)axisType.intValue == AxisType.Digital)
@@ -730,7 +730,7 @@ private void RenderInteractionList(SerializedProperty interactionList, bool useC
730730
MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile.InputActions[actionId.intValue - 1];
731731
actionId.intValue = (int)inputAction.Id;
732732
actionDescription.stringValue = inputAction.Description;
733-
actionConstraint.enumValueIndex = (int)inputAction.AxisConstraint;
733+
actionConstraint.intValue = (int)inputAction.AxisConstraint;
734734
interactionList.serializedObject.ApplyModifiedProperties();
735735
}
736736
}

Assets/MRTK/Core/Inspectors/Profiles/MixedRealityGesturesProfileInspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private void RenderList(SerializedProperty list)
224224
}
225225

226226
actionDescription.stringValue = inputAction.Description;
227-
actionConstraint.enumValueIndex = (int)inputAction.AxisConstraint;
227+
actionConstraint.intValue = (int)inputAction.AxisConstraint;
228228
serializedObject.ApplyModifiedProperties();
229229
}
230230

Assets/MRTK/Core/Inspectors/Profiles/MixedRealitySpeechCommandsProfileInspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private void RenderList(SerializedProperty list)
166166
{
167167
MixedRealityInputAction inputAction = actionId.intValue == 0 ? MixedRealityInputAction.None : MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.InputActionsProfile.InputActions[actionId.intValue - 1];
168168
actionDescription.stringValue = inputAction.Description;
169-
actionConstraint.enumValueIndex = (int)inputAction.AxisConstraint;
169+
actionConstraint.intValue = (int)inputAction.AxisConstraint;
170170
}
171171
}
172172
EditorGUILayout.Space();

Assets/MRTK/Core/Inspectors/Utilities/InspectorFieldsUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static void AddFieldsToSettingsList(SerializedProperty settings, List<Ins
8989
SerializedProperty options = settingItem.FindPropertyRelative("Options");
9090
SerializedProperty name = settingItem.FindPropertyRelative("Name");
9191

92-
type.enumValueIndex = (int)data[i].Attributes.Type;
92+
type.intValue = (int)data[i].Attributes.Type;
9393
tooltip.stringValue = data[i].Attributes.Tooltip;
9494
label.stringValue = data[i].Attributes.Label;
9595
name.stringValue = data[i].Name;

Assets/MRTK/Core/Inspectors/Utilities/InspectorUIUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public static Enum DrawEnumSerializedProperty(Rect position, SerializedProperty
535535
EditorGUI.BeginProperty(position, label, prop);
536536
{
537537
result = EditorGUI.EnumPopup(position, label, propValue);
538-
prop.enumValueIndex = Convert.ToInt32(result);
538+
prop.intValue = Convert.ToInt32(result);
539539
}
540540
EditorGUI.EndProperty();
541541

Assets/MRTK/Providers/LeapMotion/Editor/LeapMotionDeviceManagerProfileInspector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ public virtual void RenderCustomInspector()
102102
// Allow selection of the LeapVRDeviceOffsetMode if the LeapControllerOrientation is Headset
103103
EditorGUILayout.PropertyField(leapVRDeviceOffsetMode);
104104

105-
if (leapVRDeviceOffsetMode.enumValueIndex == (int)LeapVRDeviceOffsetMode.ManualHeadOffset)
105+
if (leapVRDeviceOffsetMode.intValue == (int)LeapVRDeviceOffsetMode.ManualHeadOffset)
106106
{
107107
// Display the properties for editing the head offset
108108
EditorGUILayout.PropertyField(leapVRDeviceOffsetY);
109109
EditorGUILayout.PropertyField(leapVRDeviceOffsetZ);
110110
EditorGUILayout.PropertyField(leapVRDeviceOffsetTiltX);
111111
}
112-
else if (leapVRDeviceOffsetMode.enumValueIndex == (int)LeapVRDeviceOffsetMode.Transform)
112+
else if (leapVRDeviceOffsetMode.intValue == (int)LeapVRDeviceOffsetMode.Transform)
113113
{
114114
// Display the transform property
115115
// EditorGUILayout.PropertyField() did not allow the setting the transform property in editor

Assets/MRTK/SDK/Editor/Inspectors/Exp/InteractiveEl/CompressableButtonInspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public override void OnInspectorGUI()
329329
{
330330
// Changing the DistanceSpaceMode requires updating the plane distance values so they stay in the same relative ratio positions
331331
Undo.RecordObject(target, string.Concat("Trigger Plane Distance Conversion of ", button.name));
332-
button.DistanceSpaceMode = (CompressableButton.SpaceMode)distanceSpaceMode.enumValueIndex;
332+
button.DistanceSpaceMode = (CompressableButton.SpaceMode)distanceSpaceMode.intValue;
333333
serializedObject.Update();
334334
}
335335

Assets/MRTK/SDK/Editor/Inspectors/Input/Handlers/ControllerPoseSynchronizerInspector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public override void OnInspectorGUI()
6262
var label = new GUIContent(handedness.displayName);
6363
using (new EditorGUI.PropertyScope(position, label, handedness))
6464
{
65-
var currentHandedness = (Handedness)handedness.enumValueIndex;
65+
var currentHandedness = (Handedness)handedness.intValue;
6666

67-
handedness.enumValueIndex = (int)(Handedness)EditorGUI.EnumPopup(position, label, currentHandedness,
67+
handedness.intValue = (int)(Handedness)EditorGUI.EnumPopup(position, label, currentHandedness,
6868
(value) => { return (Handedness)value == Handedness.Left || (Handedness)value == Handedness.Right; });
6969
}
7070
}

Assets/MRTK/SDK/Editor/Inspectors/UX/Collections/GridObjectCollectionInspector.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected override void OnInspectorGUIInsertion()
5252

5353

5454

55-
LayoutOrder layoutTypeIndex = (LayoutOrder)layout.enumValueIndex;
55+
LayoutOrder layoutTypeIndex = (LayoutOrder)layout.intValue;
5656
if (layoutTypeIndex == LayoutOrder.ColumnThenRow)
5757
{
5858
EditorGUILayout.HelpBox("ColumnThenRow will lay out content first horizontally (by column), then vertically (by row). NumColumns specifies number of columns per row.", MessageType.Info);
@@ -79,7 +79,7 @@ protected override void OnInspectorGUIInsertion()
7979
EditorGUILayout.PropertyField(cellHeight);
8080
}
8181

82-
ObjectOrientationSurfaceType surfaceTypeIndex = (ObjectOrientationSurfaceType)surfaceType.enumValueIndex;
82+
ObjectOrientationSurfaceType surfaceTypeIndex = (ObjectOrientationSurfaceType)surfaceType.intValue;
8383
if (surfaceTypeIndex == ObjectOrientationSurfaceType.Plane)
8484
{
8585
EditorGUILayout.PropertyField(distance, new GUIContent("Distance from parent", "Distance from parent object's origin"));
@@ -96,8 +96,7 @@ protected override void OnInspectorGUIInsertion()
9696
EditorGUILayout.PropertyField(anchor);
9797
}
9898

99-
LayoutAnchor layoutAnchor = (LayoutAnchor)anchor.enumValueIndex;
100-
if (layoutAnchor != LayoutAnchor.MiddleCenter)
99+
if ((LayoutAnchor)anchor.intValue != LayoutAnchor.MiddleCenter)
101100
{
102101
EditorGUILayout.PropertyField(anchorAlongAxis);
103102
}

Assets/MRTK/SDK/Editor/Inspectors/UX/Interactable/ButtonConfigHelperInspector.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public override void OnInspectorGUI()
107107

108108
showComponents = EditorGUILayout.Toggle("Show Component References", showComponents);
109109

110-
ButtonIconStyle oldStyle = (ButtonIconStyle)iconStyleProp.enumValueIndex;
110+
ButtonIconStyle oldStyle = (ButtonIconStyle)iconStyleProp.intValue;
111111

112112
using (new EditorGUI.IndentLevelScope(1))
113113
{
@@ -288,7 +288,7 @@ public override void OnInspectorGUI()
288288

289289
serializedObject.ApplyModifiedProperties();
290290

291-
if (oldStyle != (ButtonIconStyle)iconStyleProp.enumValueIndex)
291+
if (oldStyle != (ButtonIconStyle)iconStyleProp.intValue)
292292
{
293293
cb.ForceRefresh();
294294
}

0 commit comments

Comments
 (0)