From bbe3d1a07d027f08abe0f19e4e0386f934708d64 Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 15 Jan 2026 13:46:45 +0100 Subject: [PATCH 1/6] Update PlayerInputEditor.cs --- .../Plugins/PlayerInput/PlayerInputEditor.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs index 1d2acb500c..0991d4dc04 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs @@ -97,7 +97,11 @@ public override void OnInspectorGUI() var assetChanged = CheckIfActionAssetChanged(); // initialize the editor component if the asset has changed or if it has not been initialized yet +#if UNITY_6000_5_OR_NEWER + if (EditorGUI.EndChangeCheck() || !m_ActionAssetInitialized || assetChanged || m_ActionAssetEntityId == EntityId.None) +#else if (EditorGUI.EndChangeCheck() || !m_ActionAssetInitialized || assetChanged || m_ActionAssetInstanceID == 0) +#endif { InitializeEditorComponent(assetChanged); actionsWereChanged = true; @@ -278,6 +282,15 @@ bool CheckIfActionAssetChanged() { if (m_ActionsProperty.objectReferenceValue != null) { +#if UNITY_6000_5_OR_NEWER + EntityId assetEntityId = m_ActionsProperty.objectReferenceValue.GetEntityId(); + bool result = assetEntityId != m_ActionAssetEntityId && m_ActionAssetEntityId != EntityId.None; + m_ActionAssetEntityId = assetEntityId; + return result; + } + + m_ActionAssetEntityId = EntityId.None; +#else // 6.4 deprecates instance id in favour of entity ids (a class) // Fortunately, there is an implicit cast from entity id to an integer so we can have minimum footprint for now. int assetInstanceID; @@ -295,6 +308,8 @@ bool CheckIfActionAssetChanged() } m_ActionAssetInstanceID = -1; +#endif + return false; } @@ -656,7 +671,11 @@ void AddEntry(InputAction action, PlayerInput.ActionEvent actionEvent) [NonSerialized] private bool m_NotificationBehaviorInitialized; [NonSerialized] private bool m_ActionAssetInitialized; +#if UNITY_6000_5_OR_NEWER + [NonSerialized] private EntityId m_ActionAssetEntityId; +#else [NonSerialized] private int m_ActionAssetInstanceID; +#endif } } #endif // UNITY_EDITOR From 01021e107295604e83b061228dcbbb9b11c170d7 Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 15 Jan 2026 14:11:52 +0100 Subject: [PATCH 2/6] Update DumpInputActionReferences.cs --- Assets/Editor/DumpInputActionReferences.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/Editor/DumpInputActionReferences.cs b/Assets/Editor/DumpInputActionReferences.cs index c3703b453b..235c55f77f 100644 --- a/Assets/Editor/DumpInputActionReferences.cs +++ b/Assets/Editor/DumpInputActionReferences.cs @@ -19,8 +19,10 @@ private static void DumpReferences(StringBuilder sb, string prefix, InputActionR private static void DumpReferences() { var sb = new StringBuilder(); +#pragma warning disable CS0618 // Type or member is obsolete DumpReferences(sb, "Loaded objects", Object.FindObjectsByType( FindObjectsInactive.Include, FindObjectsSortMode.InstanceID)); +#pragma warning restore CS0618 // Type or member is obsolete DumpReferences(sb, "All objects:", Resources.FindObjectsOfTypeAll()); Debug.Log(sb.ToString()); } From 843dc5eee5199ff0206299b633b0bcad914b69d8 Mon Sep 17 00:00:00 2001 From: josepmariapujol-unity <59828124+josepmariapujol-unity@users.noreply.github.com> Date: Thu, 15 Jan 2026 14:19:00 +0100 Subject: [PATCH 3/6] Update CHANGELOG.md --- Packages/com.unity.inputsystem/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index cdb11c6c0c..874a29643b 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -10,7 +10,13 @@ however, it has to be formatted properly to pass verification tests. ## [Unreleased] - yyyy-mm-dd +### Changed + +- Updated `m_ActionAssetInstanceID` in PlayerInputEditor.cs to use `EntityId` instead of `InstanceID`. +### Fixed + +### Added ## [1.18.0] - 2026-01-14 From 3a3c0b3b96fdf339ec06f8b3218d2211676f356d Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 15 Jan 2026 14:43:28 +0100 Subject: [PATCH 4/6] Removing redundant value assignation of m_ActionAssetEntityId after update --- .../InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs index 0991d4dc04..783b0f2eee 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs @@ -289,7 +289,6 @@ bool CheckIfActionAssetChanged() return result; } - m_ActionAssetEntityId = EntityId.None; #else // 6.4 deprecates instance id in favour of entity ids (a class) // Fortunately, there is an implicit cast from entity id to an integer so we can have minimum footprint for now. @@ -309,7 +308,6 @@ bool CheckIfActionAssetChanged() m_ActionAssetInstanceID = -1; #endif - return false; } From 214b03fa6df5e3499200d6c2b3ffae65d8d6476e Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Fri, 16 Jan 2026 14:59:13 +0100 Subject: [PATCH 5/6] Update PlayerInputEditor.cs --- .../Plugins/PlayerInput/PlayerInputEditor.cs | 31 ++++++------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs index 783b0f2eee..c95174a3fe 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs @@ -97,7 +97,7 @@ public override void OnInspectorGUI() var assetChanged = CheckIfActionAssetChanged(); // initialize the editor component if the asset has changed or if it has not been initialized yet -#if UNITY_6000_5_OR_NEWER +#if UNITY_6000_4_OR_NEWER if (EditorGUI.EndChangeCheck() || !m_ActionAssetInitialized || assetChanged || m_ActionAssetEntityId == EntityId.None) #else if (EditorGUI.EndChangeCheck() || !m_ActionAssetInitialized || assetChanged || m_ActionAssetInstanceID == 0) @@ -280,35 +280,22 @@ public override void OnInspectorGUI() // One such case is when the user triggers a "Reset" on the component. bool CheckIfActionAssetChanged() { - if (m_ActionsProperty.objectReferenceValue != null) - { -#if UNITY_6000_5_OR_NEWER - EntityId assetEntityId = m_ActionsProperty.objectReferenceValue.GetEntityId(); + var obj = m_ActionsProperty.objectReferenceValue; + if (obj == null) + return false; + +#if UNITY_6000_4_OR_NEWER + EntityId assetEntityId = obj.GetEntityId(); bool result = assetEntityId != m_ActionAssetEntityId && m_ActionAssetEntityId != EntityId.None; m_ActionAssetEntityId = assetEntityId; return result; - } - #else - // 6.4 deprecates instance id in favour of entity ids (a class) - // Fortunately, there is an implicit cast from entity id to an integer so we can have minimum footprint for now. - int assetInstanceID; - - #if UNITY_6000_4_OR_NEWER - assetInstanceID = m_ActionsProperty.objectReferenceValue.GetEntityId(); - #else - assetInstanceID = m_ActionsProperty.objectReferenceValue.GetInstanceID(); - #endif - + int assetInstanceID = obj.GetInstanceID(); // 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; m_ActionAssetInstanceID = (int)assetInstanceID; return result; - } - - m_ActionAssetInstanceID = -1; #endif - return false; } private void DoHelpCreateAssetUI() @@ -669,7 +656,7 @@ void AddEntry(InputAction action, PlayerInput.ActionEvent actionEvent) [NonSerialized] private bool m_NotificationBehaviorInitialized; [NonSerialized] private bool m_ActionAssetInitialized; -#if UNITY_6000_5_OR_NEWER +#if UNITY_6000_4_OR_NEWER [NonSerialized] private EntityId m_ActionAssetEntityId; #else [NonSerialized] private int m_ActionAssetInstanceID; From 8f4595b5b5e499c1983d1983afb9f80e58ebc14b Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Fri, 16 Jan 2026 15:19:04 +0100 Subject: [PATCH 6/6] Update PlayerInputEditor.cs --- .../Plugins/PlayerInput/PlayerInputEditor.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs index c95174a3fe..6727dbd96d 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs @@ -283,18 +283,18 @@ bool CheckIfActionAssetChanged() var obj = m_ActionsProperty.objectReferenceValue; if (obj == null) return false; - + #if UNITY_6000_4_OR_NEWER - EntityId assetEntityId = obj.GetEntityId(); - bool result = assetEntityId != m_ActionAssetEntityId && m_ActionAssetEntityId != EntityId.None; - m_ActionAssetEntityId = assetEntityId; - return result; + EntityId assetEntityId = obj.GetEntityId(); + bool result = assetEntityId != m_ActionAssetEntityId && m_ActionAssetEntityId != EntityId.None; + m_ActionAssetEntityId = assetEntityId; + return result; #else - int assetInstanceID = obj.GetInstanceID(); - // 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; - m_ActionAssetInstanceID = (int)assetInstanceID; - return result; + int assetInstanceID = obj.GetInstanceID(); + // 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; + m_ActionAssetInstanceID = (int)assetInstanceID; + return result; #endif }