Skip to content

Commit d426234

Browse files
CHANGE: Enable IMGUI Asset Editor for input action assets when UITK is available (ISX-1541) (#1731)
The UITK Editor view is only enabled for the Project Wide Actions Asset Editor, in the Project Settings.
1 parent 1a5f8fb commit d426234

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ internal class InputActionEditorWindow : EditorWindow, IDisposable
3838
public static bool OnOpenAsset(int instanceId, int line)
3939
{
4040
#if UNITY_INPUT_SYSTEM_UI_TK_ASSET_EDITOR
41-
if (InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseUIToolkitEditor))
41+
if (InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseUIToolkitEditor) && InputActionsEditorWindow.isWindowEnabled)
4242
return false;
4343
#endif
44-
4544
var path = AssetDatabase.GetAssetPath(instanceId);
4645
if (!path.EndsWith(k_FileExtension, StringComparison.InvariantCultureIgnoreCase))
4746
return false;

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ static EnableUITKEditor()
2424
internal class InputActionsEditorWindow : EditorWindow
2525
{
2626
private static readonly string k_FileExtension = "." + InputActionAsset.Extension;
27+
/// <summary>
28+
/// Controls whether the UITK version of the InputActionAsset Editor is enabled or not for editing Input Action
29+
/// assets.
30+
/// </summary>
31+
/// At the moment, the UITK Asset Editor doesn't have feature parity with the IMGUI version.
32+
/// This is set to false to show the IMGUI version of the InputActionAsset Editor instead.
33+
internal static bool isWindowEnabled = false;
2734
private int m_AssetId;
2835
private string m_AssetPath;
2936
private string m_AssetJson;
@@ -32,7 +39,7 @@ internal class InputActionsEditorWindow : EditorWindow
3239
[OnOpenAsset]
3340
public static bool OpenAsset(int instanceId, int line)
3441
{
35-
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseUIToolkitEditor))
42+
if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseUIToolkitEditor) || !isWindowEnabled)
3643
return false;
3744

3845
var path = AssetDatabase.GetAssetPath(instanceId);

0 commit comments

Comments
 (0)