Skip to content

Commit 84b8fb3

Browse files
authored
FIX: ISXB-1718 Corrections to not generate warnings on Unity 6.3b05. (#2257)
1 parent 6e964ce commit 84b8fb3

File tree

9 files changed

+24
-16
lines changed

9 files changed

+24
-16
lines changed

Assets/Tests/InputSystem/CorePerformanceTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ public void Performance_ReadEveryKey()
123123

124124
Measure.Method(() =>
125125
{
126-
int keyIndex = 0;
127126
foreach (var key in keyboard.allKeys)
128127
{
129128
key.ReadValue();

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ however, it has to be formatted properly to pass verification tests.
1010

1111
## [Unreleased] - yyyy-mm-dd
1212

13-
13+
### Fixed
14+
- Fixed warnings being generated on Unity 6.3 (beta). (ISXB-1718).
1415

1516
## [1.15.0] - 2025-10-03
1617

Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
using UnityEngine.InputSystem.LowLevel;
1414
using UnityEngine.InputSystem.Utilities;
1515

16-
// Suppress warnings from local variables for control references
17-
// that we don't end up using.
16+
// Suppress warnings from local variables for control references that we don't end up using.
1817
#pragma warning disable CS0219
1918

19+
// Suppress warnings from obsolete code when references from auto-generated code from the same code base.
20+
#pragma warning disable CS0618
21+
2022
namespace UnityEngine.InputSystem
2123
{
2224
internal partial class FastKeyboard : UnityEngine.InputSystem.Keyboard

Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
using UnityEngine.InputSystem.LowLevel;
1414
using UnityEngine.InputSystem.Utilities;
1515

16-
// Suppress warnings from local variables for control references
17-
// that we don't end up using.
16+
// Suppress warnings from local variables for control references that we don't end up using.
1817
#pragma warning disable CS0219
1918

19+
// Suppress warnings from obsolete code when references from auto-generated code from the same code base.
20+
#pragma warning disable CS0618
21+
2022
namespace UnityEngine.InputSystem
2123
{
2224
internal partial class FastMouse : UnityEngine.InputSystem.Mouse

Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
using UnityEngine.InputSystem.LowLevel;
1414
using UnityEngine.InputSystem.Utilities;
1515

16-
// Suppress warnings from local variables for control references
17-
// that we don't end up using.
16+
// Suppress warnings from local variables for control references that we don't end up using.
1817
#pragma warning disable CS0219
1918

19+
// Suppress warnings from obsolete code when references from auto-generated code from the same code base.
20+
#pragma warning disable CS0618
21+
2022
namespace UnityEngine.InputSystem
2123
{
2224
internal partial class FastTouchscreen : UnityEngine.InputSystem.Touchscreen

Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ static InputActionEditorWindow()
4242
InputActionAssetEditor.RegisterType<InputActionEditorWindow>();
4343
}
4444

45-
// Unity 6.4 changed signature of OpenAsset, and now it accepts entity id instead of instance id.
45+
// Unity 6.3 changed signature of OpenAsset, and now it accepts entity id instead of instance id.
4646
[OnOpenAsset]
47-
#if UNITY_6000_4_OR_NEWER
47+
#if UNITY_6000_3_OR_NEWER
4848
public static bool OpenAsset(EntityId entityId, int line)
4949
{
5050
if (!InputActionImporter.IsInputActionAssetPath(AssetDatabase.GetAssetPath(entityId)))

Packages/com.unity.inputsystem/InputSystem/Editor/InputLayoutCodeGenerator.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ public static unsafe string GenerateCodeForDeviceLayout(string layoutName, strin
105105
writer.WriteLine("using UnityEngine.InputSystem.LowLevel;");
106106
writer.WriteLine("using UnityEngine.InputSystem.Utilities;");
107107
writer.WriteLine("");
108-
writer.WriteLine("// Suppress warnings from local variables for control references");
109-
writer.WriteLine("// that we don't end up using.");
108+
writer.WriteLine("// Suppress warnings from local variables for control references that we don't end up using.");
110109
writer.WriteLine("#pragma warning disable CS0219");
111110
writer.WriteLine("");
111+
writer.WriteLine("// Suppress warnings from obsolete code when references from auto-generated code from the same code base.");
112+
writer.WriteLine("#pragma warning disable CS0618");
113+
writer.WriteLine("");
112114
if (!string.IsNullOrEmpty(@namespace))
113115
{
114116
writer.WriteLine("namespace " + @namespace);

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ static InputActionsEditorWindow()
4848
m_Analytics ??= new InputActionsEditorSessionAnalytic(
4949
InputActionsEditorSessionAnalytic.Data.Kind.EditorWindow);
5050

51-
// Unity 6.4 changed signature of OpenAsset, and now it accepts entity id instead of instance id.
51+
// Unity 6.3 changed signature of OpenAsset, and now it accepts entity id instead of instance id.
5252
[OnOpenAsset]
53-
#if UNITY_6000_4_OR_NEWER
53+
#if UNITY_6000_3_OR_NEWER
5454
public static bool OpenAsset(EntityId entityId, int line)
5555
{
5656
if (!InputActionImporter.IsInputActionAssetPath(AssetDatabase.GetAssetPath(entityId)))

Packages/com.unity.inputsystem/InputSystem/InputSystem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3695,10 +3695,10 @@ internal static void OnPlayModeChange(PlayModeStateChange change)
36953695
}
36963696
}
36973697

3698-
// We have this function to hide away instanceId -> entityId migration that happened in Unity 6.4
3698+
// We have this function to hide away instanceId -> entityId migration that happened in Unity 6.3
36993699
public static bool HasNativeObject(Object obj)
37003700
{
3701-
#if UNITY_6000_4_OR_NEWER
3701+
#if UNITY_6000_3_OR_NEWER
37023702
return EditorUtility.EntityIdToObject(obj.GetEntityId()) != null;
37033703
#else
37043704
return EditorUtility.InstanceIDToObject(obj.GetInstanceID()) != null;

0 commit comments

Comments
 (0)