Skip to content

Commit eefd9bc

Browse files
committed
Guard PropertyDrawer with EditorGUI.BeginProperty/EndProperty.
1 parent 335ecb1 commit eefd9bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionReferencePropertyDrawer.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ internal sealed class InputActionReferencePropertyDrawer : PropertyDrawer
2222

2323
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
2424
{
25-
// Sets the property to null if the action is not found in the asset.
25+
EditorGUI.BeginProperty(position, label, property);
26+
2627
ValidatePropertyWithDanglingInputActionReferences(property);
2728

2829
ObjectField.DoObjectField(position, property, typeof(InputActionReference), label,
2930
m_Context, SearchConstants.PickerViewFlags);
31+
32+
EditorGUI.EndProperty();
3033
}
3134

3235
static void ValidatePropertyWithDanglingInputActionReferences(SerializedProperty property)
@@ -37,7 +40,6 @@ static void ValidatePropertyWithDanglingInputActionReferences(SerializedProperty
3740
if (action is null)
3841
{
3942
property.objectReferenceValue = null;
40-
property.serializedObject.ApplyModifiedProperties();
4143
}
4244
}
4345
}

0 commit comments

Comments
 (0)