Skip to content

Commit 5fb9517

Browse files
committed
Only check dangling project-wide action references
1 parent 4e16a51 commit 5fb9517

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ static void ValidatePropertyWithDanglingInputActionReferences(SerializedProperty
3333
{
3434
if (property?.objectReferenceValue is InputActionReference reference)
3535
{
36-
var action = reference?.asset?.FindAction(reference.action.id);
37-
if (action is null)
36+
// Check only if the reference is a project-wide action.
37+
if (reference?.asset?.name == ProjectWideActionsAsset.kAssetName)
3838
{
39-
property.objectReferenceValue = null;
40-
property.serializedObject.ApplyModifiedProperties();
39+
var action = reference?.asset?.FindAction(reference.action.id);
40+
if (action is null)
41+
{
42+
property.objectReferenceValue = null;
43+
property.serializedObject.ApplyModifiedProperties();
44+
}
4145
}
4246
}
4347
}

0 commit comments

Comments
 (0)