Skip to content

Commit fbee9b1

Browse files
authored
CHANGE: Restructured main Input System Package settings nodes when Project wide actions are available (#1791)
* CHANGE: Restructured main Input System Package settings node to be Input Actions and Settings to be a child node when Project Wide Actions are available.
1 parent fa5f304 commit fbee9b1

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ however, it has to be formatted properly to pass verification tests.
1919
- 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.
2020
- 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.
2121
- Re-enabled some UI tests that were disabled on iOS.
22+
- 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.
2223

2324
### Added
2425
- Support for [Game rotation vector](https://developer.android.com/reference/android/hardware/Sensor#TYPE_GAME_ROTATION_VECTOR) sensor on Android

Packages/com.unity.inputsystem/InputSystem/Editor/Settings/InputSettingsProvider.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,23 @@
1313
#pragma warning disable CS0414
1414
namespace UnityEngine.InputSystem.Editor
1515
{
16+
internal static class InputSettingsPath
17+
{
18+
public const string kSettingsRootPath = "Project/Input System Package";
19+
}
20+
1621
internal class InputSettingsProvider : SettingsProvider, IDisposable
1722
{
1823
public const string kEditorBuildSettingsConfigKey = "com.unity.input.settings";
1924
public const string kEditorBuildSettingsActionsConfigKey = "com.unity.input.settings.actions";
25+
26+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
27+
// When Project Wide Actions are enabled we place this as a child node to main settings node.
28+
public const string kSettingsPath = InputSettingsPath.kSettingsRootPath + "/Settings";
29+
#else
30+
// When Project Wide Actions are not enabled we let this be the main settings node.
2031
public const string kSettingsPath = "Project/Input System Package";
32+
#endif
2133

2234
public static void Open()
2335
{
@@ -27,7 +39,14 @@ public static void Open()
2739
[SettingsProvider]
2840
public static SettingsProvider CreateInputSettingsProvider()
2941
{
30-
return new InputSettingsProvider(kSettingsPath, SettingsScope.Project);
42+
return new InputSettingsProvider(kSettingsPath, SettingsScope.Project)
43+
{
44+
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
45+
// We put this in a child node called "Settings" when Project-wide Actions is enabled.
46+
// When not enabled it sits on the main package Settings node.
47+
label = "Settings"
48+
#endif
49+
};
3150
}
3251

3352
private InputSettingsProvider(string path, SettingsScope scopes)

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace UnityEngine.InputSystem.Editor
77
{
88
internal class InputActionsEditorSettingsProvider : SettingsProvider
99
{
10-
public const string kSettingsPath = "Project/Input System Package/Actions";
10+
public const string kSettingsPath = InputSettingsPath.kSettingsRootPath;
1111

1212
[SerializeField] InputActionsEditorState m_State;
1313
VisualElement m_RootVisualElement;
@@ -112,12 +112,7 @@ private void BuildUI()
112112
[SettingsProvider]
113113
public static SettingsProvider CreateGlobalInputActionsEditorProvider()
114114
{
115-
var provider = new InputActionsEditorSettingsProvider(kSettingsPath, SettingsScope.Project)
116-
{
117-
label = "Input Actions"
118-
};
119-
120-
return provider;
115+
return new InputActionsEditorSettingsProvider(kSettingsPath, SettingsScope.Project);
121116
}
122117
}
123118
}

0 commit comments

Comments
 (0)