diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 683c5f4b7e..60d6933ca9 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -19,6 +19,7 @@ however, it has to be formatted properly to pass verification tests. - Input Action Asset editors Auto-save feature has been modified to trigger on focus-lost when activated instead of triggering on every modification to the asset in order to reduce impact of processing required to handle modified assets. - Project-wide input actions template extension changed from .inputactions to .json. This avoids showing template actions in the action's selector UI that are not intended to be used. - Re-enabled some UI tests that were disabled on iOS. +- Reorganized package Project Settings so that "Input System Package" setting node contains "Input Actions" and "Settings" becomes a child node when Project-wide Actions are available. For Unity versions where Project-wide Actions are not available, the settings structure remains unchanged. ### Added - Support for [Game rotation vector](https://developer.android.com/reference/android/hardware/Sensor#TYPE_GAME_ROTATION_VECTOR) sensor on Android diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs index 7bb317014c..3270693fed 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs @@ -13,11 +13,23 @@ #pragma warning disable CS0414 namespace UnityEngine.InputSystem.Editor { + internal static class InputSettingsPath + { + public const string kSettingsRootPath = "Project/Input System Package"; + } + internal class InputSettingsProvider : SettingsProvider, IDisposable { public const string kEditorBuildSettingsConfigKey = "com.unity.input.settings"; public const string kEditorBuildSettingsActionsConfigKey = "com.unity.input.settings.actions"; + + #if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS + // When Project Wide Actions are enabled we place this as a child node to main settings node. + public const string kSettingsPath = InputSettingsPath.kSettingsRootPath + "/Settings"; + #else + // When Project Wide Actions are not enabled we let this be the main settings node. public const string kSettingsPath = "Project/Input System Package"; + #endif public static void Open() { @@ -27,7 +39,14 @@ public static void Open() [SettingsProvider] public static SettingsProvider CreateInputSettingsProvider() { - return new InputSettingsProvider(kSettingsPath, SettingsScope.Project); + return new InputSettingsProvider(kSettingsPath, SettingsScope.Project) + { + #if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS + // We put this in a child node called "Settings" when Project-wide Actions is enabled. + // When not enabled it sits on the main package Settings node. + label = "Settings" + #endif + }; } private InputSettingsProvider(string path, SettingsScope scopes) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs index 0eac5ce70e..e76ba99475 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorSettingsProvider.cs @@ -7,7 +7,7 @@ namespace UnityEngine.InputSystem.Editor { internal class InputActionsEditorSettingsProvider : SettingsProvider { - public const string kSettingsPath = "Project/Input System Package/Actions"; + public const string kSettingsPath = InputSettingsPath.kSettingsRootPath; [SerializeField] InputActionsEditorState m_State; VisualElement m_RootVisualElement; @@ -112,12 +112,7 @@ private void BuildUI() [SettingsProvider] public static SettingsProvider CreateGlobalInputActionsEditorProvider() { - var provider = new InputActionsEditorSettingsProvider(kSettingsPath, SettingsScope.Project) - { - label = "Input Actions" - }; - - return provider; + return new InputActionsEditorSettingsProvider(kSettingsPath, SettingsScope.Project); } } }