Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ however, it has to be formatted properly to pass verification tests.
## [Unreleased] - yyyy-mm-dd

### Fixed
- Fixed a problem with the logic to get the active player settings object that cause an infinit reimport loop. [ISXB-1430](https://jira.unity3d.com/browse/ISXB-1430)
- Fixed an issue where removing a newly created action in the Asset Editor would cause an exception. [UUM-95693](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-95693)
- Fixed arrow key navigation of Input Actions after Action rename. [ISXB-1024](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1024)
- Fixed gamepad navigation in UI Toolkit TextField when using InputSystemUIInputModule. [UUM-77364](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-77364)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
using System.Linq;
using UnityEditor;

#if UNITY_6000_0_OR_NEWER
using System.Reflection;
using UnityEditor.Build.Profile;
#endif

namespace UnityEngine.InputSystem.Editor
{
internal static class EditorPlayerSettingHelpers
Expand Down Expand Up @@ -154,7 +159,33 @@ private static int TupleToActiveInputHandler((bool newSystemEnabled, bool oldSys

private static SerializedProperty GetPropertyOrNull(string name)
{
#if UNITY_6000_0_OR_NEWER
// HOTFIX: the code below works around an issue causing an infinite reimport loop
// this will be replaced by a call to an API in the editor instead of using reflection once it is available
var buildProfileType = typeof(BuildProfile);
var globalPlayerSettingsField = buildProfileType.GetField("s_GlobalPlayerSettings", BindingFlags.Static | BindingFlags.NonPublic);
if (globalPlayerSettingsField == null)
{
Debug.LogError($"Could not find global player settings field in build profile when trying to get property {name}. Please try to update the Input System package.");
return null;
}
var playerSettings = (PlayerSettings)globalPlayerSettingsField.GetValue(null);
var activeBuildProfile = BuildProfile.GetActiveBuildProfile();
if (activeBuildProfile != null)
{
var playerSettingsOverrideField = buildProfileType.GetField("m_PlayerSettings", BindingFlags.Instance | BindingFlags.NonPublic);
if (playerSettingsOverrideField == null)
{
Debug.LogError($"Could not find player settings override field in build profile when trying to get property {name}. Please try to update the Input System package.");
return null;
}
var playerSettingsOverride = (PlayerSettings)playerSettingsOverrideField.GetValue(activeBuildProfile);
if (playerSettingsOverride != null)
playerSettings = playerSettingsOverride;
}
#else
var playerSettings = Resources.FindObjectsOfTypeAll<PlayerSettings>().FirstOrDefault();
#endif
if (playerSettings == null)
return null;
var playerSettingsObject = new SerializedObject(playerSettings);
Expand Down