Skip to content

Commit 27322b1

Browse files
authored
FIX: UI generation of custom interactions of action properties when it rely on OnGUI callback (ISXB-886) (#1957)
- Fixed the UI generation of enum fields when editing interactions of action properties. The new selected value was lost when saving. - Fixed the UI generation of custom interactions of action properties when it rely on OnGUI callback. [ISXB-886](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-886)
1 parent dddce7d commit 27322b1

File tree

13 files changed

+39
-1
lines changed

13 files changed

+39
-1
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ however, it has to be formatted properly to pass verification tests.
2929
- Fixed a performance issue with many objects using multiple action maps [ISXB-573](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-573).
3030
- Fixed an variable scope shadowing issue causing compilation to fail on Unity 2019 LTS.
3131
- Fixed an issue where changing `InputSettings` instance would not affect associated feature flags.
32+
- Fixed the UI generation of enum fields when editing interactions of action properties. The new selected value was lost when saving.
33+
- Fixed the UI generation of custom interactions of action properties when it rely on OnGUI callback. [ISXB-886](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-886).
3234

3335
### Added
3436
- Added additional device information when logging the error due to exceeding the maximum number of events processed

Packages/com.unity.inputsystem/InputSystem/Actions/Composites/AxisComposite.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ internal class AxisCompositeEditor : InputParameterEditor<AxisComposite>
219219

220220
public override void OnGUI()
221221
{
222+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
223+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
224+
#endif
222225
target.whichSideWins = (AxisComposite.WhichSideWins)EditorGUILayout.EnumPopup(m_WhichAxisWinsLabel, target.whichSideWins);
223226
}
224227

Packages/com.unity.inputsystem/InputSystem/Actions/Composites/Vector2Composite.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ internal class Vector2CompositeEditor : InputParameterEditor<Vector2Composite>
199199

200200
public override void OnGUI()
201201
{
202+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
203+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
204+
#endif
202205
target.mode = (Vector2Composite.Mode)EditorGUILayout.EnumPopup(m_ModeLabel, target.mode);
203206
}
204207

Packages/com.unity.inputsystem/InputSystem/Actions/Composites/Vector3Composite.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ internal class Vector3CompositeEditor : InputParameterEditor<Vector3Composite>
179179

180180
public override void OnGUI()
181181
{
182+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
183+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
184+
#endif
182185
target.mode = (Vector3Composite.Mode)EditorGUILayout.EnumPopup(m_ModeLabel, target.mode);
183186
}
184187

Packages/com.unity.inputsystem/InputSystem/Actions/Interactions/HoldInteraction.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ protected override void OnEnable()
124124

125125
public override void OnGUI()
126126
{
127+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
128+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
129+
#endif
127130
m_PressPointSetting.OnGUI();
128131
m_DurationSetting.OnGUI();
129132
}

Packages/com.unity.inputsystem/InputSystem/Actions/Interactions/MultiTapInteraction.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ protected override void OnEnable()
196196

197197
public override void OnGUI()
198198
{
199+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
200+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
201+
#endif
199202
target.tapCount = EditorGUILayout.IntField(m_TapCountLabel, target.tapCount);
200203
m_TapDelaySetting.OnGUI();
201204
m_TapTimeSetting.OnGUI();

Packages/com.unity.inputsystem/InputSystem/Actions/Interactions/PressInteraction.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ protected override void OnEnable()
213213

214214
public override void OnGUI()
215215
{
216+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
217+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
218+
#endif
216219
EditorGUILayout.HelpBox(s_HelpBoxText);
217220
target.behavior = (PressBehavior)EditorGUILayout.EnumPopup(s_PressBehaviorLabel, target.behavior);
218221
m_PressPointSetting.OnGUI();

Packages/com.unity.inputsystem/InputSystem/Actions/Interactions/SlowTapInteraction.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ protected override void OnEnable()
8888

8989
public override void OnGUI()
9090
{
91+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
92+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
93+
#endif
9194
m_DurationSetting.OnGUI();
9295
m_PressPointSetting.OnGUI();
9396
}

Packages/com.unity.inputsystem/InputSystem/Actions/Interactions/TapInteraction.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ protected override void OnEnable()
102102

103103
public override void OnGUI()
104104
{
105+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
106+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
107+
#endif
105108
m_DurationSetting.OnGUI();
106109
m_PressPointSetting.OnGUI();
107110
}

Packages/com.unity.inputsystem/InputSystem/Controls/Processors/AxisDeadzoneProcessor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ protected override void OnEnable()
9393

9494
public override void OnGUI()
9595
{
96+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
97+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
98+
#endif
9699
m_MinSetting.OnGUI();
97100
m_MaxSetting.OnGUI();
98101
}

0 commit comments

Comments
 (0)