From 8138a956431fdc4b81c4eaa6a8f56852afef4e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akan=20Sidenvall?= Date: Fri, 10 Oct 2025 10:09:44 +0200 Subject: [PATCH 1/4] FIX: ISXB-1718 Corrections to not generate warnings on Unity 6.3b05. Also updated precompiled layouts since FastKeyboard was generating a warning and updated code generator to suppress deprecated/obsolete warnings in generated code. Changed constraints on previous warning fixes. --- .../InputSystem/Devices/Precompiled/FastKeyboard.cs | 6 ++++-- .../InputSystem/Devices/Precompiled/FastMouse.cs | 6 ++++-- .../InputSystem/Devices/Precompiled/FastTouchscreen.cs | 6 ++++-- .../Editor/AssetEditor/InputActionEditorWindow.cs | 4 ++-- .../InputSystem/Editor/InputLayoutCodeGenerator.cs | 6 ++++-- .../Editor/UITKAssetEditor/InputActionsEditorWindow.cs | 4 ++-- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs index dfbf339265..cd0bbb3e57 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs @@ -13,10 +13,12 @@ using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; -// Suppress warnings from local variables for control references -// that we don't end up using. +// Suppress warnings from local variables for control references that we don't end up using. #pragma warning disable CS0219 +// Suppress warnings from obsolete code when references from auto-generated code from the same code base. +#pragma warning disable CS0618 + namespace UnityEngine.InputSystem { internal partial class FastKeyboard : UnityEngine.InputSystem.Keyboard diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs index f0ff3624b6..c5ab918fb1 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs @@ -13,10 +13,12 @@ using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; -// Suppress warnings from local variables for control references -// that we don't end up using. +// Suppress warnings from local variables for control references that we don't end up using. #pragma warning disable CS0219 +// Suppress warnings from obsolete code when references from auto-generated code from the same code base. +#pragma warning disable CS0618 + namespace UnityEngine.InputSystem { internal partial class FastMouse : UnityEngine.InputSystem.Mouse diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs index f92586e3a2..06f018a61a 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs @@ -13,10 +13,12 @@ using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; -// Suppress warnings from local variables for control references -// that we don't end up using. +// Suppress warnings from local variables for control references that we don't end up using. #pragma warning disable CS0219 +// Suppress warnings from obsolete code when references from auto-generated code from the same code base. +#pragma warning disable CS0618 + namespace UnityEngine.InputSystem { internal partial class FastTouchscreen : UnityEngine.InputSystem.Touchscreen diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs index b0b457639f..1e88a026dc 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs @@ -42,9 +42,9 @@ static InputActionEditorWindow() InputActionAssetEditor.RegisterType(); } - // Unity 6.4 changed signature of OpenAsset, and now it accepts entity id instead of instance id. + // Unity 6.3 changed signature of OpenAsset, and now it accepts entity id instead of instance id. [OnOpenAsset] -#if UNITY_6000_4_OR_NEWER +#if UNITY_6000_3_OR_NEWER public static bool OpenAsset(EntityId entityId, int line) { if (!InputActionImporter.IsInputActionAssetPath(AssetDatabase.GetAssetPath(entityId))) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/InputLayoutCodeGenerator.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/InputLayoutCodeGenerator.cs index bb3c339268..6f83561975 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/InputLayoutCodeGenerator.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/InputLayoutCodeGenerator.cs @@ -105,10 +105,12 @@ public static unsafe string GenerateCodeForDeviceLayout(string layoutName, strin writer.WriteLine("using UnityEngine.InputSystem.LowLevel;"); writer.WriteLine("using UnityEngine.InputSystem.Utilities;"); writer.WriteLine(""); - writer.WriteLine("// Suppress warnings from local variables for control references"); - writer.WriteLine("// that we don't end up using."); + writer.WriteLine("// Suppress warnings from local variables for control references that we don't end up using."); writer.WriteLine("#pragma warning disable CS0219"); writer.WriteLine(""); + writer.WriteLine("// Suppress warnings from obsolete code when references from auto-generated code from the same code base."); + writer.WriteLine("#pragma warning disable CS0618"); + writer.WriteLine(""); if (!string.IsNullOrEmpty(@namespace)) { writer.WriteLine("namespace " + @namespace); diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs index 90aac7d04d..6f08da5045 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs @@ -48,9 +48,9 @@ static InputActionsEditorWindow() m_Analytics ??= new InputActionsEditorSessionAnalytic( InputActionsEditorSessionAnalytic.Data.Kind.EditorWindow); - // Unity 6.4 changed signature of OpenAsset, and now it accepts entity id instead of instance id. + // Unity 6.3 changed signature of OpenAsset, and now it accepts entity id instead of instance id. [OnOpenAsset] -#if UNITY_6000_4_OR_NEWER +#if UNITY_6000_3_OR_NEWER public static bool OpenAsset(EntityId entityId, int line) { if (!InputActionImporter.IsInputActionAssetPath(AssetDatabase.GetAssetPath(entityId))) From 8c2dd7159234862cabf44078f44975c6a493230d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akan=20Sidenvall?= Date: Fri, 10 Oct 2025 10:14:08 +0200 Subject: [PATCH 2/4] Updated CHANGELOG.md --- Packages/com.unity.inputsystem/CHANGELOG.md | 3 ++- Packages/com.unity.inputsystem/InputSystem/InputSystem.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index aa5e19e05e..c321d77d63 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -10,7 +10,8 @@ however, it has to be formatted properly to pass verification tests. ## [Unreleased] - yyyy-mm-dd - +### Fixed +- Fixed warnings being generated on Unity 6.3 (beta). (ISXB-1718). ## [1.15.0] - 2025-10-03 diff --git a/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs b/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs index 34d4462e22..f99c216cfa 100644 --- a/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs +++ b/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs @@ -3698,7 +3698,7 @@ internal static void OnPlayModeChange(PlayModeStateChange change) // We have this function to hide away instanceId -> entityId migration that happened in Unity 6.4 public static bool HasNativeObject(Object obj) { -#if UNITY_6000_4_OR_NEWER +#if UNITY_6000_3_OR_NEWER return EditorUtility.EntityIdToObject(obj.GetEntityId()) != null; #else return EditorUtility.InstanceIDToObject(obj.GetInstanceID()) != null; From a8357e796973e1616b7e27d731c1ac9d0947c04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akan=20Sidenvall?= Date: Fri, 10 Oct 2025 10:48:14 +0200 Subject: [PATCH 3/4] Corrected outdated comment. --- Packages/com.unity.inputsystem/InputSystem/InputSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs b/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs index f99c216cfa..968e19b43d 100644 --- a/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs +++ b/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs @@ -3695,7 +3695,7 @@ internal static void OnPlayModeChange(PlayModeStateChange change) } } - // We have this function to hide away instanceId -> entityId migration that happened in Unity 6.4 + // We have this function to hide away instanceId -> entityId migration that happened in Unity 6.3 public static bool HasNativeObject(Object obj) { #if UNITY_6000_3_OR_NEWER From 78027e2d4f8886f42cd4c1f06e5f47c570622de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akan=20Sidenvall?= Date: Mon, 13 Oct 2025 11:11:56 +0200 Subject: [PATCH 4/4] Removed unused variable causing warning on 2021.3 --- Assets/Tests/InputSystem/CorePerformanceTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/Tests/InputSystem/CorePerformanceTests.cs b/Assets/Tests/InputSystem/CorePerformanceTests.cs index 3f4fd03599..65874f9dc7 100644 --- a/Assets/Tests/InputSystem/CorePerformanceTests.cs +++ b/Assets/Tests/InputSystem/CorePerformanceTests.cs @@ -123,7 +123,6 @@ public void Performance_ReadEveryKey() Measure.Method(() => { - int keyIndex = 0; foreach (var key in keyboard.allKeys) { key.ReadValue();