From ac0ac4dc48d3a1fd069b42d51c5c48ab3fc31d40 Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 12 Mar 2026 16:15:07 +0100 Subject: [PATCH 1/7] fix --- Assets/Tests/InputSystem/Plugins/UITests.cs | 1 + .../com.unity.inputsystem/InputSystem/Controls/ButtonControl.cs | 2 ++ .../InputSystem/State/InputStateBuffers.cs | 1 + .../InputSystem/Utilities/InternedString.cs | 1 + 4 files changed, 5 insertions(+) diff --git a/Assets/Tests/InputSystem/Plugins/UITests.cs b/Assets/Tests/InputSystem/Plugins/UITests.cs index 15f17299ea..6b246bd5db 100644 --- a/Assets/Tests/InputSystem/Plugins/UITests.cs +++ b/Assets/Tests/InputSystem/Plugins/UITests.cs @@ -4601,6 +4601,7 @@ private class UICallbackReceiver : MonoBehaviour, IPointerClickHandler, IPointer IPointerMoveHandler, IPointerExitHandler, IPointerUpHandler, IMoveHandler, ISelectHandler, IDeselectHandler, IInitializePotentialDragHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IDropHandler, ISubmitHandler, ICancelHandler, IScrollHandler { + [Serializable] public struct Event { public EventType type { get; } diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/ButtonControl.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/ButtonControl.cs index e04f4ebf8a..dee118c96e 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Controls/ButtonControl.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Controls/ButtonControl.cs @@ -1,3 +1,4 @@ +using System; using System.Runtime.CompilerServices; using UnityEngine.InputSystem.LowLevel; using UnityEngine.Scripting; @@ -15,6 +16,7 @@ namespace UnityEngine.InputSystem.Controls /// yield full floating-point values and may thus have a range of values. See /// for how button presses on such buttons are handled. /// + [Serializable] public class ButtonControl : AxisControl { private bool m_NeedsToCheckFramePress = false; diff --git a/Packages/com.unity.inputsystem/InputSystem/State/InputStateBuffers.cs b/Packages/com.unity.inputsystem/InputSystem/State/InputStateBuffers.cs index 8bcffd38b4..eae5349bbe 100644 --- a/Packages/com.unity.inputsystem/InputSystem/State/InputStateBuffers.cs +++ b/Packages/com.unity.inputsystem/InputSystem/State/InputStateBuffers.cs @@ -13,6 +13,7 @@ namespace UnityEngine.InputSystem.LowLevel // Internally, we perform only a single combined unmanaged allocation for all state // buffers needed by the system. Externally, we expose them as if they are each separate // buffers. + [Serializable] internal unsafe struct InputStateBuffers { // State buffers are set up in a double buffering scheme where the "back buffer" diff --git a/Packages/com.unity.inputsystem/InputSystem/Utilities/InternedString.cs b/Packages/com.unity.inputsystem/InputSystem/Utilities/InternedString.cs index 8badfff055..b720afd57e 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Utilities/InternedString.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Utilities/InternedString.cs @@ -24,6 +24,7 @@ namespace UnityEngine.InputSystem.Utilities /// There is a non-zero cost to creating an InternedString. The first time a new unique InternedString /// is encountered, there may also be a GC heap allocation. /// + [Serializable] public struct InternedString : IEquatable, IComparable { private readonly string m_StringOriginalCase; From 34dd12ea70c239e90582b0bb5f74ffde671972f3 Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 12 Mar 2026 16:44:04 +0100 Subject: [PATCH 2/7] fix --- .../Tests/InputSystem.Editor/InputActionReferenceEditorTests.cs | 2 +- .../InputSystem/Editor/Internal/InputStateWindow.cs | 2 +- Packages/com.unity.inputsystem/InputSystem/Utilities/FourCC.cs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/Tests/InputSystem.Editor/InputActionReferenceEditorTests.cs b/Assets/Tests/InputSystem.Editor/InputActionReferenceEditorTests.cs index b8ae447c81..02d2be0f4f 100644 --- a/Assets/Tests/InputSystem.Editor/InputActionReferenceEditorTests.cs +++ b/Assets/Tests/InputSystem.Editor/InputActionReferenceEditorTests.cs @@ -98,7 +98,7 @@ private void DisableDomainReloads() EditorPrefsTestUtils.DisableDomainReload(); } - private static InputActionBehaviour GetBehaviour() => Object.FindFirstObjectByType(); + private static InputActionBehaviour GetBehaviour() => Object.FindAnyObjectByType(); private static InputActionAsset GetAsset() => AssetDatabase.LoadAssetAtPath(assetPath); // For unclear reason, NUnit fails to assert throwing exceptions after transition into play-mode. diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs index 7e4a5fd7a3..7bf32a8fe5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs @@ -400,7 +400,7 @@ private void DrawHexDump() // against any mutations. // When inspecting controls (as opposed to events), we copy all their various // state buffers and allow switching between them. - [SerializeField] private byte[][] m_StateBuffers; + [NonSerialized] private byte[][] m_StateBuffers; [SerializeField] private int m_SelectedStateBuffer; [SerializeField] private bool m_CompareStateBuffers; [SerializeField] private bool m_ShowDifferentOnly; diff --git a/Packages/com.unity.inputsystem/InputSystem/Utilities/FourCC.cs b/Packages/com.unity.inputsystem/InputSystem/Utilities/FourCC.cs index 8a024ec036..4e1c220baf 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Utilities/FourCC.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Utilities/FourCC.cs @@ -11,6 +11,7 @@ namespace UnityEngine.InputSystem.Utilities /// FourCCs are frequently used in the input system to identify the format of data sent to or from /// the native backend representing events, input device state or commands sent to input devices. /// + [Serializable] public struct FourCC : IEquatable { private int m_Code; From 92f13b4ff2724e16ce50403520bb52216b68dc4c Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 12 Mar 2026 16:58:40 +0100 Subject: [PATCH 3/7] Update InputActionsEditorState.cs --- .../Editor/UITKAssetEditor/InputActionsEditorState.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs index 01190a3ad4..0db3942f12 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs @@ -59,6 +59,8 @@ private int GetActionMapIndex(InputActionsEditorState state) return cutActionMapIndex ?? -1; } } + + [Serializable] internal struct InputActionsEditorState { public int selectedActionMapIndex { get {return m_selectedActionMapIndex; } } From cc62946f4b353b25fa093615b40499a7d2a887b5 Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 12 Mar 2026 17:04:42 +0100 Subject: [PATCH 4/7] Update AxisControl.cs --- .../com.unity.inputsystem/InputSystem/Controls/AxisControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/AxisControl.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/AxisControl.cs index d69846c5e2..d584108efc 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Controls/AxisControl.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Controls/AxisControl.cs @@ -1,3 +1,4 @@ +using System; using System.Runtime.CompilerServices; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Processors; @@ -16,6 +17,7 @@ namespace UnityEngine.InputSystem.Controls /// Can optionally be configured to perform normalization. /// Stored as either a float, a short, a byte, or a single bit. /// + [Serializable] public class AxisControl : InputControl { /// From 37ca86764ef9acf73e90d9f33f318b4b34d302bf Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 12 Mar 2026 17:29:35 +0100 Subject: [PATCH 5/7] Formatting --- .../Editor/UITKAssetEditor/InputActionsEditorState.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs index 0db3942f12..df34c468a8 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorState.cs @@ -59,7 +59,7 @@ private int GetActionMapIndex(InputActionsEditorState state) return cutActionMapIndex ?? -1; } } - + [Serializable] internal struct InputActionsEditorState { From c4c88d0c2be396b89ba4f35a57ae68ffbe7b1fb9 Mon Sep 17 00:00:00 2001 From: JosepMariaPujol Date: Thu, 12 Mar 2026 17:41:58 +0100 Subject: [PATCH 6/7] Update InputControl.cs --- .../com.unity.inputsystem/InputSystem/Controls/InputControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs index cca6b2e07c..9cdc7734f8 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControl.cs @@ -83,6 +83,7 @@ namespace UnityEngine.InputSystem /// /// /// + [Serializable] [DebuggerDisplay("{DebuggerDisplay(),nq}")] public abstract class InputControl { @@ -1283,6 +1284,7 @@ internal virtual IEnumerable GetProcessors() /// Type of value captured by the control. Note that this does not mean /// that the control has to store data in the given value format. A control that captures float /// values, for example, may be stored in state as byte values instead. + [Serializable] public abstract class InputControl : InputControl where TValue : struct { From bed62b28d566125771abdff6cfafbf0c9958009d Mon Sep 17 00:00:00 2001 From: josepmariapujol-unity <59828124+josepmariapujol-unity@users.noreply.github.com> Date: Thu, 12 Mar 2026 17:43:08 +0100 Subject: [PATCH 7/7] Remove Serializable attribute from InternedString --- .../InputSystem/Utilities/InternedString.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Utilities/InternedString.cs b/Packages/com.unity.inputsystem/InputSystem/Utilities/InternedString.cs index b720afd57e..8badfff055 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Utilities/InternedString.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Utilities/InternedString.cs @@ -24,7 +24,6 @@ namespace UnityEngine.InputSystem.Utilities /// There is a non-zero cost to creating an InternedString. The first time a new unique InternedString /// is encountered, there may also be a GC heap allocation. /// - [Serializable] public struct InternedString : IEquatable, IComparable { private readonly string m_StringOriginalCase;