From 38250a110ab861b5fbd7d6be7b77f5e0ba43d885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Akan=20Sidenvall?= Date: Mon, 10 Feb 2025 16:38:22 +0100 Subject: [PATCH] FIX: Parameter editor not reacting to changes to InputSettings --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + .../Editor/InputParameterEditor.cs | 65 +++++++++++-------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index f8abaceb26..e65f6a8bc8 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -23,6 +23,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed an issue where compiling Addressables with Input System package present would result in failed compilation due to `IInputAnalytic.TryGatherData` not being defined [ISXB-1203](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1203). - Pinned Touch Samples sample package dependencies to avoid errors with Cinemachine 3.x and Probuilder 6.x. [ISXB-1245](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1245) - Fixed an issue where dropdown menu for Path in Input Actions Editor could not be selected from any button position. [ISXB-1309](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1309) +- Fixed an issue where changing Input System default parameter settings with the editor open would result in changes in the editor. [ISXB-1351](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1351) ## [1.12.0] - 2025-01-15 diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/InputParameterEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/InputParameterEditor.cs index 2ecbf89e00..6d7efc2e3d 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/InputParameterEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/InputParameterEditor.cs @@ -238,8 +238,10 @@ public void OnDrawVisualElements(VisualElement root, Action onChangedCallback) value = m_DefaultInitializedValue; var container = new VisualElement(); - var settingsContainer = new VisualElement { style = { flexDirection = FlexDirection.Row } }; + container.RegisterCallback(OnAttachToPanel); + container.RegisterCallback(OnDetachFromPanel); + var settingsContainer = new VisualElement { style = { flexDirection = FlexDirection.Row } }; m_FloatField = new FloatField(m_ValueLabel.text) { value = value }; m_FloatField.Q("unity-text-input").AddToClassList("float-field"); @@ -260,7 +262,6 @@ public void OnDrawVisualElements(VisualElement root, Action onChangedCallback) m_DefaultToggle.RegisterValueChangedCallback(evt => ToggleUseDefaultValue(evt, onChangedCallback)); m_DefaultToggle.Q