Skip to content

Commit da27148

Browse files
authored
Merge branch 'develop' into type-registration-source-generator
2 parents e3d6275 + c79a0b5 commit da27148

File tree

14 files changed

+66
-27
lines changed

14 files changed

+66
-27
lines changed

Assets/Samples/InGameHints/InGameHintsActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.16.1
4+
// version 1.17.1
55
// from Assets/Samples/InGameHints/InGameHintsActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Samples/SimpleDemo/SimpleControls.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.16.1
4+
// version 1.17.1
55
// from Assets/Samples/SimpleDemo/SimpleControls.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.16.1
4+
// version 1.17.1
55
// from Assets/Tests/InputSystem/InputActionCodeGeneratorActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Packages/com.unity.inputsystem/CHANGELOG.md

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

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

13+
14+
15+
## [1.17.0] - 2025-11-25
16+
1317
### Changed
1418
- Project-Wide Input Actions support can no longer be compiled out (removed the `UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS` define). (ISX-2397)
1519
- Removed code that had to do with Unity versions older than Unity 2022.3 LTS. (ISX-2396)
@@ -19,7 +23,9 @@ however, it has to be formatted properly to pass verification tests.
1923
### Fixed
2024
- An issue where a UITK MouseEvent was triggered when changing from Scene View to Game View in the Editor has been fixed. [ISXB-1671](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1671)
2125
- Fix documentation error in file AndroidGameController.cs mentioning a wrong controller. [DOCATT-9806]
22-
26+
- Deferred auto-registration of processors, interactions and composite binding types referenced by `InputActionAsset`
27+
to only happen once when an unresolved type reference is found in an action definition. This avoids reflective
28+
type loading from assemblies for all cases where the Input System is not extended. (ISXB-1766).
2329

2430
## [1.16.0] - 2025-11-10
2531

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static partial class InputSystem
1818
// Keep this in sync with "Packages/com.unity.inputsystem/package.json".
1919
// NOTE: Unfortunately, System.Version doesn't use semantic versioning so we can't include
2020
// "-preview" suffixes here.
21-
internal const string kAssemblyVersion = "1.16.1";
22-
internal const string kDocUrl = "https://docs.unity3d.com/Packages/com.unity.inputsystem@1.16";
21+
internal const string kAssemblyVersion = "1.17.1";
22+
internal const string kDocUrl = "https://docs.unity3d.com/Packages/com.unity.inputsystem@1.17";
2323
}
2424
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator
4-
// version 1.16.1
4+
// version 1.17.1
55
// from "Keyboard" layout
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator
4-
// version 1.16.1
4+
// version 1.17.1
55
// from "Mouse" layout
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator
4-
// version 1.16.1
4+
// version 1.17.1
55
// from "Touchscreen" layout
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

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

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,9 +1913,9 @@ private void InitializeActions()
19131913
internal void InitializeData()
19141914
{
19151915
m_Layouts.Allocate();
1916-
m_Processors.Initialize();
1917-
m_Interactions.Initialize();
1918-
m_Composites.Initialize();
1916+
m_Processors.Initialize(this);
1917+
m_Interactions.Initialize(this);
1918+
m_Composites.Initialize(this);
19191919
m_DevicesById = new Dictionary<int, InputDevice>();
19201920

19211921
// Determine our default set of enabled update types. By
@@ -2026,11 +2026,11 @@ internal void InitializeData()
20262026
composites.AddTypeRegistration("OneModifier", typeof(OneModifierComposite));
20272027
composites.AddTypeRegistration("TwoModifiers", typeof(TwoModifiersComposite));
20282028

2029-
// Register custom types by reflection
2030-
//RegisterCustomTypes();
2029+
// ISXB-1766: Defer loading custom types by reflection unless we have to since referenced from
2030+
// .inputaction JSON assets. This is managed via TypeTable.cs.
20312031
}
20322032

2033-
void RegisterCustomTypes(Type[] types)
2033+
static void RegisterCustomTypes(Type[] types)
20342034
{
20352035
foreach (Type type in types)
20362036
{
@@ -2053,8 +2053,18 @@ void RegisterCustomTypes(Type[] types)
20532053
}
20542054
}
20552055

2056-
void RegisterCustomTypes()
2056+
private bool m_CustomTypesRegistered;
2057+
2058+
internal bool RegisterCustomTypes()
20572059
{
2060+
// If we have already attempted to register custom types, there is no need to reattempt since we
2061+
// would end up with the same result again. Only with a domain reload would the resulting types
2062+
// be different, and hence it is sufficient to use a static flag that we do not reset.
2063+
if (m_CustomTypesRegistered)
2064+
return false; // Already evaluated
2065+
2066+
m_CustomTypesRegistered = true;
2067+
20582068
k_InputRegisterCustomTypesMarker.Begin();
20592069

20602070
var inputSystemAssembly = typeof(InputProcessor).Assembly;
@@ -2079,11 +2089,13 @@ void RegisterCustomTypes()
20792089
}
20802090
catch (ReflectionTypeLoadException)
20812091
{
2082-
continue;
2092+
// Ignore exception
20832093
}
20842094
}
20852095

20862096
k_InputRegisterCustomTypesMarker.End();
2097+
2098+
return true; // Signal that custom types were extracted and registered.
20872099
}
20882100

20892101
internal void InstallRuntime(IInputRuntime runtime)
@@ -2164,6 +2176,9 @@ internal void UninstallGlobals()
21642176
InputControlLayout.s_CacheInstance = default;
21652177
InputControlLayout.s_CacheInstanceRef = 0;
21662178

2179+
// Invalidate type registrations
2180+
m_CustomTypesRegistered = false;
2181+
21672182
// Detach from runtime.
21682183
if (m_Runtime != null)
21692184
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ public static bool IsFirstLayoutBasedOnSecond(string firstLayoutName, string sec
868868
/// different names. When doing so, the first registration is considered as the "proper"
869869
/// name for the processor and all subsequent registrations will be considered aliases.
870870
///
871-
/// See the <a href="../manual/Processors.html">manual</a> for more details.
871+
/// See the <a href="../manual/UsingProcessors.html">manual</a> for more details.
872872
/// </remarks>
873873
/// <seealso cref="InputProcessor{T}"/>
874874
/// <seealso cref="InputBinding.processors"/>
@@ -998,7 +998,7 @@ public static void RegisterProcessor(Type type, string name = null)
998998
/// different names. When doing so, the first registration is considered as the "proper"
999999
/// name for the processor and all subsequent registrations will be considered aliases.
10001000
///
1001-
/// See the <a href="../manual/Processors.html">manual</a> for more details.
1001+
/// See the <a href="../manual/UsingProcessors.html">manual</a> for more details.
10021002
/// </remarks>
10031003
/// <seealso cref="InputProcessor{T}"/>
10041004
/// <seealso cref="InputBinding.processors"/>

0 commit comments

Comments
 (0)