Skip to content

Commit fc01f13

Browse files
committed
Make InputEditorUserSettings work again and deal
1 parent c5e8d47 commit fc01f13

6 files changed

Lines changed: 8 additions & 11 deletions

File tree

Packages/com.unity.inputsystem/Editor/InputSystemEditorInitializer.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ internal static void InitializeInEditor(bool calledFromCtor, IInputRuntime runti
209209
InputSystem.s_Manager.m_SavedDeviceStates = s_StateManager.systemState.managerState.devices;
210210
InputSystem.s_Manager.m_SavedAvailableDevices = s_StateManager.systemState.managerState.availableDevices;
211211

212-
// InputEditorUserSettings.s_Settings = s_StateManager.systemState.userSettings;
212+
InputEditorUserSettings.s_Settings = s_StateManager.systemState.userSettings;
213213

214214
s_StateManager.systemState = new InputSystemState();
215215
}
@@ -233,10 +233,8 @@ internal static void InitializeInEditor(bool calledFromCtor, IInputRuntime runti
233233
SetUpEditorRemoting();
234234
}
235235

236-
//TODO EDITOR CODE SPLIT: fix this
237-
// Debug.Assert(settings != null);
238-
// Debug.Assert(HasNativeObject(settings), "InputSettings has lost its native object");
239-
236+
Debug.Assert(InputSystem.settings != null);
237+
Debug.Assert(HasNativeObject(InputSystem.settings), "InputSettings has lost its native object");
240238

241239
UnityRemoteSupport.Initialize();
242240

Packages/com.unity.inputsystem/Editor/InputSystemStateManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ public void OnBeforeSerialize()
7070
}
7171

7272
systemState.remoteConnection = InputSystem.remoteConnection;
73-
//TODO: fix
74-
// systemState.userSettings = InputEditorUserSettings.s_Settings;
73+
systemState.userSettings = InputEditorUserSettings.s_Settings;
7574
}
7675

7776
public void OnAfterDeserialize()

Packages/com.unity.inputsystem/Editor/Settings/InputEditorUserSettings.cs renamed to Packages/com.unity.inputsystem/Runtime/InputEditorUserSettings.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
////TODO: event diagnostics should have a bool here
66

7-
namespace UnityEngine.InputSystem.Editor
7+
namespace UnityEngine.InputSystem
88
{
99
/// <summary>
1010
/// Settings that are local to the current user and specific to the input system's use in the editor.
1111
/// </summary>
1212
/// <remarks>
1313
/// These settings are not stored in assets in the project along with the other input settings.
1414
/// Instead, they are serialized to JSON and stored in the project's Library/ folder.
15+
///
16+
/// They are currently part of the Runtime code because they don't have any particular Editor dependency.
1517
/// </remarks>
1618
internal static class InputEditorUserSettings
1719
{

Packages/com.unity.inputsystem/Editor/Settings/InputEditorUserSettings.cs.meta renamed to Packages/com.unity.inputsystem/Runtime/InputEditorUserSettings.cs.meta

File renamed without changes.

Packages/com.unity.inputsystem/Runtime/InputSystem.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3369,8 +3369,6 @@ public static bool runInBackground
33693369
#if DEVELOPMENT_BUILD || UNITY_EDITOR
33703370
private static RemoteInputPlayerConnection s_RemoteConnection;
33713371

3372-
//TODO decide if we want to have a setter
3373-
// This was a quick fix necessary after FEPM
33743372
internal static RemoteInputPlayerConnection remoteConnection
33753373
{
33763374
get => s_RemoteConnection;

Packages/com.unity.inputsystem/Runtime/InputSystemState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal struct InputSystemState
2121
[SerializeField] public InputManager.SerializedState managerState;
2222
[SerializeField] public InputRemoting.SerializedState remotingState;
2323
#if UNITY_EDITOR
24-
// [SerializeField] public InputEditorUserSettings.SerializedState userSettings;
24+
[SerializeField] public InputEditorUserSettings.SerializedState userSettings;
2525
[SerializeField] public string systemObject;
2626
#endif
2727
////TODO: make these saved states capable of surviving domain reloads

0 commit comments

Comments
 (0)