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
4 changes: 4 additions & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ however, it has to be formatted properly to pass verification tests.
- Fixed tooltip support in the UI Toolkit version of the Input Actions Asset editor.
- Fixed documentation to clarify bindings with modifiers `overrideModifiersNeedToBePressedFirst` configuration [ISXB-806](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-806).
- Fixed an issue in `Samples/Visualizers/GamepadVisualizer.unity` sample where the visualization wouldn't handle device disconnects or current device changes properly (ISXB-1243).
- Fixed an issue when displaying Serialized InputAction's Processor properties inside the Inspector window. [ISXB-1269](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1269)

### Changed
- Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086).
- Changed `OnScreenControl` to automaticaly switch, in Single Player with autoswitch enabled, to the target device control scheme when the first component is enabled to prevent bad interactions when it start.
- Changed paremeter `overrideModifiersNeedToBePressedFirst` to obsolete for `ButtonWithOneModifier`, `ButtonWithTwoModifiers`, `OneModifierComposite` and `TwoModifiersComposite` in favour the new `modifiersOrder` parameter which is more explicit.
- Changed `Samples/Visualizers/GamepadVisualizer.unity` to visualize the control values of the current device instead of the first device.

### Added
- Added new API `InputSystem.settings.useIMGUIEditorForAssets` that should be used in custom `InputParameterEditor` that use both IMGUI and UI Toolkit.

## [1.11.2] - 2024-10-16

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ internal class AxisCompositeEditor : InputParameterEditor<AxisComposite>
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
target.whichSideWins = (AxisComposite.WhichSideWins)EditorGUILayout.EnumPopup(m_WhichAxisWinsLabel, target.whichSideWins);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ internal class Vector2CompositeEditor : InputParameterEditor<Vector2Composite>
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
target.mode = (Vector2Composite.Mode)EditorGUILayout.EnumPopup(m_ModeLabel, target.mode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ internal class Vector3CompositeEditor : InputParameterEditor<Vector3Composite>
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
target.mode = (Vector3Composite.Mode)EditorGUILayout.EnumPopup(m_ModeLabel, target.mode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected override void OnEnable()
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
m_PressPointSetting.OnGUI();
m_DurationSetting.OnGUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected override void OnEnable()
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
target.tapCount = EditorGUILayout.IntField(m_TapCountLabel, target.tapCount);
m_TapDelaySetting.OnGUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ protected override void OnEnable()
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
EditorGUILayout.HelpBox(s_HelpBoxText);
target.behavior = (PressBehavior)EditorGUILayout.EnumPopup(s_PressBehaviorLabel, target.behavior);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected override void OnEnable()
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
m_DurationSetting.OnGUI();
m_PressPointSetting.OnGUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected override void OnEnable()
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
m_DurationSetting.OnGUI();
m_PressPointSetting.OnGUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected override void OnEnable()
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
m_MinSetting.OnGUI();
m_MaxSetting.OnGUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected override void OnEnable()
public override void OnGUI()
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
m_MinSetting.OnGUI();
m_MaxSetting.OnGUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static InputActionEditorWindow()
public static bool OnOpenAsset(int instanceId, int line)
{
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets))
if (!InputSystem.settings.useIMGUIEditorForAssets)
return false;
#endif
var path = AssetDatabase.GetAssetPath(instanceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public void OnGUI()

#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
// handled by OnDrawVisualElements with UI Toolkit
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return;
if (!InputSystem.settings.useIMGUIEditorForAssets) return;
#endif
// Otherwise, fall back to our default logic.
if (m_Parameters == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private static void OpenEditor(InputActionAsset asset)
}

// Redirect to UI-Toolkit window editor if not configured to use IMGUI explicitly
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets))
if (!InputSystem.settings.useIMGUIEditorForAssets)
InputActionsEditorWindow.OpenEditor(asset);
else
InputActionEditorWindow.OpenEditor(asset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,12 @@ public static void Show(Rect btnRect, PropertiesViewBase view)
window.ShowAsDropDown(btnRect, new Vector2(300, 350));
}

private Vector2 m_ScrollPos;
private void OnGUI()
{
m_ScrollPos = EditorGUILayout.BeginScrollView(m_ScrollPos);
m_PropertyView.OnGUI();
EditorGUILayout.EndScrollView();
}

private PropertiesViewBase m_PropertyView;
Expand Down
11 changes: 11 additions & 0 deletions Packages/com.unity.inputsystem/InputSystem/InputSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,17 @@ public enum InputActionPropertyDrawerMode
MultilineBoth,
}

#if UNITY_EDITOR && UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
/// <summary>
/// Determines if we should render the UI with IMGUI even if an UI Toolkit UI is available.
///
/// This should be used when writing a custom <see cref="InputParameterEditor"/> to :
/// * support inspector view which only work in IMGUI for now.
/// * prevent the UI to be rendered in IMGUI and UI Toolkit in the Input Actions Editor window.
/// </summary>
public bool useIMGUIEditorForAssets => UnityEditor.EditorGUI.indentLevel > 0 || IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets);
#endif

private static bool CompareFloats(float a, float b)
{
return (a - b) <= float.Epsilon;
Expand Down
Loading