Skip to content

Commit 24ad8c3

Browse files
authored
CHANGE: Remove code to support Unity versions older than 2021.3 (#2267)
1 parent a317819 commit 24ad8c3

File tree

17 files changed

+4
-121
lines changed

17 files changed

+4
-121
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ however, it has to be formatted properly to pass verification tests.
1313
### Changed
1414
- Replaced "Look" rebinding button for "Keyboard" control scheme with a mouse sensitivity slider in `RebindingUISample` to illustrate how to support customizing scaling of mouse deltas and how to reapply the persisted setting between runs.
1515
- Changed: Input System no longer depends the obsolete com.unity.modules.vr package.
16+
- Removed code that had to do with Unity versions older than Unity 2021.3 LTS.
1617

1718
### Added
1819
- Added an example of how to swap two similar controls to the `RebindingUISample`. This is accessible via a button with two arrows at the right hand-side of the screen. Pressing the button allows swapping the current bindings of the "Move" and "Look" gamepad bindings via the new `RebindActionUI.SwapBinding(RebindActionUI other)` method.

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,12 +1931,7 @@ public void Finish()
19311931
}
19321932

19331933
device.m_ButtonControlsCheckingPressState = new List<ButtonControl>(i);
1934-
#if UNITY_2020_1_OR_NEWER
19351934
device.m_UpdatedButtons = new HashSet<int>(i);
1936-
#else
1937-
// 2019 is too old to support setting HashSet capacity
1938-
device.m_UpdatedButtons = new HashSet<int>();
1939-
#endif
19401935

19411936
device.isSetupFinished = true;
19421937
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,7 @@ public InputDevice Finish()
7575
}
7676

7777
device.m_ButtonControlsCheckingPressState = new List<ButtonControl>(i);
78-
#if UNITY_2020_1_OR_NEWER
7978
device.m_UpdatedButtons = new HashSet<int>(i);
80-
#else
81-
// 2019 is too old to support setting HashSet capacity
82-
device.m_UpdatedButtons = new HashSet<int>();
83-
#endif
8479

8580
// Kill off our state.
8681
Reset();

Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionAssetEditor.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,8 @@ private static void Process(string[] assets, ICollection<string> target)
247247
}
248248
}
249249

250-
// Note: Callback prior to Unity 2021.2 did not provide a boolean indicating domain relaod.
251-
#if UNITY_2021_2_OR_NEWER
252250
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
253251
string[] movedAssets, string[] movedFromAssetPaths, bool didDomainReload)
254-
#else
255-
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
256-
string[] movedAssets, string[] movedFromAssetPaths)
257-
#endif
258252
{
259253
Process(importedAssets, s_Imported);
260254
Process(deletedAssets, s_Deleted);

Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporter.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
using System.IO;
55
using System.Linq;
66
using UnityEditor;
7-
#if UNITY_2020_2_OR_NEWER
87
using UnityEditor.AssetImporters;
9-
#else
10-
using UnityEditor.Experimental.AssetImporters;
11-
#endif
128
using UnityEngine.InputSystem.Utilities;
139

1410
////FIXME: The importer accesses icons through the asset db (which EditorGUIUtility.LoadIcon falls back on) which will
@@ -381,14 +377,8 @@ private static bool ContainsInputActionAssetPath(string[] assetPaths)
381377
// the name will no longer be a mismatch and the cycle will be aborted.
382378
private class InputActionJsonNameModifierAssetProcessor : AssetPostprocessor
383379
{
384-
// Note: Callback prior to Unity 2021.2 did not provide a boolean indicating domain relaod.
385-
#if UNITY_2021_2_OR_NEWER
386380
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
387381
string[] movedAssets, string[] movedFromAssetPaths, bool didDomainReload)
388-
#else
389-
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
390-
string[] movedAssets, string[] movedFromAssetPaths)
391-
#endif
392382
{
393383
var needToInvalidate = false;
394384
foreach (var assetPath in importedAssets)

Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporterEditor.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
using System.IO;
44
using UnityEngine.InputSystem.Utilities;
55
using UnityEditor;
6-
#if UNITY_2020_2_OR_NEWER
76
using UnityEditor.AssetImporters;
8-
#else
9-
using UnityEditor.Experimental.AssetImporters;
10-
#endif
117

128
////TODO: support for multi-editing
139

Packages/com.unity.inputsystem/InputSystem/Editor/DeviceSimulator/InputSystemPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if UNITY_EDITOR && UNITY_2021_1_OR_NEWER
1+
#if UNITY_EDITOR
22

33
using System;
44
using System.Collections.Generic;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if UNITY_EDITOR && UNITY_2020_2_OR_NEWER
1+
#if UNITY_EDITOR
22
using System;
33
using System.Collections.ObjectModel;
44
using UnityEditor;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if ((UNITY_EDITOR && UNITY_2021_1_OR_NEWER) || PACKAGE_DOCS_GENERATION)
1+
#if (UNITY_EDITOR || PACKAGE_DOCS_GENERATION)
22
using System;
33
using System.Collections.Generic;
44
using UnityEditor;

Packages/com.unity.inputsystem/InputSystem/Editor/Internal/EditorHelpers.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,7 @@ internal static bool SaveAsset(string assetPath, string text)
129129
// Maps path into a physical path.
130130
public static string GetPhysicalPath(string path)
131131
{
132-
// Note that we can only get physical path for 2021.2 or newer
133-
#if UNITY_2021_2_OR_NEWER
134132
return FileUtil.GetPhysicalPath(path);
135-
#else
136-
return path;
137-
#endif
138133
}
139134
}
140135
}

0 commit comments

Comments
 (0)