Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ however, it has to be formatted properly to pass verification tests.
- Fixed PlayerInput component automatically switching away from the default ActionMap set to 'None'.
- Fixed a console error being shown when targeting visionOS builds in 2022.3.
- Fixed a Tap Interaction issue with analog controls. The Tap interaction would keep re-starting after timeout. [ISXB-627](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-627)
- Fixed the defaultActionMap dropdown in the PlayerInput component defaulting to <None> instead of the first ActionMap.

## [1.14.0] - 2025-03-20

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_ActionsProperty);
var actionsWereChanged = false;
if (EditorGUI.EndChangeCheck() || !m_ActionAssetInitialized || CheckIfActionAssetChanged())
var assetChanged = CheckIfActionAssetChanged();

Check warning on line 83 in Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs#L83

Added line #L83 was not covered by tests
// initialize the editor component if the asset has changed or if it has not been initialized yet
if (EditorGUI.EndChangeCheck() || !m_ActionAssetInitialized || assetChanged || m_ActionAssetInstanceID == 0)

Check warning on line 85 in Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs#L85

Added line #L85 was not covered by tests
{
OnActionAssetChange();
InitializeEditorComponent(assetChanged);

Check warning on line 87 in Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs#L87

Added line #L87 was not covered by tests
actionsWereChanged = true;
}

Expand Down Expand Up @@ -262,7 +264,8 @@
if (m_ActionsProperty.objectReferenceValue != null)
{
var assetInstanceID = m_ActionsProperty.objectReferenceValue.GetInstanceID();
bool result = assetInstanceID != m_ActionAssetInstanceID;
// if the m_ActionAssetInstanceID is 0 the PlayerInputEditor has not been initialized yet, but the asset did not change
bool result = assetInstanceID != m_ActionAssetInstanceID && m_ActionAssetInstanceID != 0;

Check warning on line 268 in Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs#L268

Added line #L268 was not covered by tests
m_ActionAssetInstanceID = (int)assetInstanceID;
return result;
}
Expand Down Expand Up @@ -439,19 +442,21 @@
m_NotificationBehaviorInitialized = true;
}

private void OnActionAssetChange()
private void InitializeEditorComponent(bool assetChanged)
{
serializedObject.ApplyModifiedProperties();
m_ActionAssetInitialized = true;

var playerInput = (PlayerInput)target;
var asset = (InputActionAsset)m_ActionsProperty.objectReferenceValue;

if (assetChanged)
m_SelectedDefaultActionMap = -1;

Check warning on line 454 in Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs#L453-L454

Added lines #L453 - L454 were not covered by tests
if (asset == null)
{
m_ControlSchemeOptions = null;
m_ActionMapOptions = null;
m_ActionNames = null;
m_SelectedDefaultActionMap = -1;
m_SelectedDefaultControlScheme = -1;
m_InvalidDefaultControlSchemeName = null;
return;
Expand Down