-
Notifications
You must be signed in to change notification settings - Fork 333
CHANGE: Split Runtime and Editor code into separate folders to prepare for Module migration #2321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
7f400e0
9306b7e
9e71717
e169d1c
f46d3bc
9163992
df3dee6
5acc184
4cb5fa9
8f6ce25
1f70b67
ecff638
238b898
f556493
84efcfb
107c47a
9d1353a
a67857b
5a8185f
ab2a6c5
a5171cf
d57fd38
50402b5
4a00486
cc3c9c8
01ddf24
84c2376
9cc7083
d2dc73b
f252727
0dd6cd2
9928e5c
a107d5c
fbbfac3
4c10e75
dd4fbdf
fe19f29
8cc6c65
37c6d0b
6ffe356
0f98803
69af1d0
f1e41a1
47e54a3
45b8dec
0eca0b8
13ec636
9941866
e888e90
2a990c9
a225669
0bf8c41
d801822
f13594a
c560c03
c63041e
9be432b
da28f42
89ee592
24a6469
8f29d65
6134d44
34137b5
a979176
467ea67
deff341
f60d5be
68cfafc
cf40a50
19d25e1
ffa26a0
e2b8693
269222e
1377db4
1cdd8fa
a517e6f
02fdac7
a90b449
9b95343
c5e8d47
fc01f13
060f76b
33a398f
89f8ecc
b0443a2
67de004
3fff4b1
5dedf58
8ef8139
4e72b8d
7b35840
d7229fd
246b3e0
bf8738c
9c3e951
98bfd90
bb1da87
e7cd723
4f15cef
a0cc851
3f02d38
bda4a33
887503f
d552b0e
0b3b8b3
320d28c
5125d68
81fc9b7
d0ea96d
3b15c1e
8e248a9
cf17bc3
e29f4ee
1e446a3
39000ea
3287e65
34a5d1c
d8a3405
010f993
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,16 @@ | ||
| { | ||
| "name": "Unity.InputSystem.Recorder", | ||
| "rootNamespace": "", | ||
| "references": [ | ||
| "GUID:75469ad4d38634e559750d17036d5f7c" | ||
| ], | ||
| "optionalUnityReferences": [], | ||
| "includePlatforms": [], | ||
| "excludePlatforms": [], | ||
| "allowUnsafeCode": true, | ||
| "overrideReferences": false, | ||
| "precompiledReferences": [], | ||
| "autoReferenced": true, | ||
| "defineConstraints": [], | ||
| "versionDefines": [] | ||
| "versionDefines": [], | ||
| "noEngineReferences": false | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,16 @@ | ||
| { | ||
| "name": "Unity.InputSystem.RebindingUI", | ||
| "rootNamespace": "", | ||
| "references": [ | ||
| "GUID:75469ad4d38634e559750d17036d5f7c" | ||
| ], | ||
| "optionalUnityReferences": [], | ||
| "includePlatforms": [], | ||
| "excludePlatforms": [], | ||
| "allowUnsafeCode": false, | ||
| "overrideReferences": false, | ||
| "precompiledReferences": [], | ||
| "autoReferenced": false, | ||
| "defineConstraints": [], | ||
| "versionDefines": [] | ||
| "versionDefines": [], | ||
| "noEngineReferences": false | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,16 @@ | ||
| { | ||
| "name": "InputSystem.Samples.Visualizers", | ||
| "rootNamespace": "", | ||
| "references": [ | ||
| "GUID:75469ad4d38634e559750d17036d5f7c" | ||
| ], | ||
| "optionalUnityReferences": [], | ||
| "includePlatforms": [], | ||
| "excludePlatforms": [], | ||
| "allowUnsafeCode": true, | ||
| "overrideReferences": false, | ||
| "precompiledReferences": [], | ||
| "autoReferenced": true, | ||
| "defineConstraints": [], | ||
| "versionDefines": [] | ||
| "versionDefines": [], | ||
| "noEngineReferences": false | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -334,12 +334,12 @@ public void Editor_DomainReload_CanRemoveDevicesDuringDomainReload() | |
| InputSystem.AddDevice<Keyboard>(); // just to make sure keyboard stays as-is | ||
|
|
||
| currentTime = 1; | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't have to be addressed by this PR, but I believe we should make sure we have a ticket filed on replacing these "faked play-mode state transitions" with real ones when this already sits in a proper editor test? |
||
|
|
||
| runtime.ReportInputDeviceRemoved(device); | ||
|
|
||
| currentTime = 2; | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
|
|
||
| InputSystem.Update(); | ||
|
|
||
|
|
@@ -2826,10 +2826,10 @@ public void Editor_InputEventsOccurringWhileGoingIntoPlayMode_AreDiscarded() | |
|
|
||
| // We need to actually pass time and have a non-zero start time for this to work. | ||
| currentTime = 1; | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystem.QueueStateEvent(mouse, new MouseState { position = new Vector2(234, 345) }); | ||
| currentTime = 2; | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
|
|
||
| InputSystem.Update(); | ||
|
|
||
|
|
@@ -2919,8 +2919,8 @@ public void Editor_InitializeInEditor_EnablesProjectWideActions() | |
| Assert.That(InputSystem.actions.enabled, Is.True); | ||
|
|
||
| // Calling exit play mode callbacks will disable them | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredEditMode); | ||
|
|
||
| Assert.That(InputSystem.actions.enabled, Is.False); | ||
|
|
||
|
|
@@ -2931,8 +2931,8 @@ public void Editor_InitializeInEditor_EnablesProjectWideActions() | |
| // `InputSystem.InitializeInEditor()` is called. Before this test was introduced, project-wide actions were | ||
| // enabled after entering play mode again which would lead to a different behavior than Player | ||
| // builds. | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
|
|
||
| Assert.That(InputSystem.actions.enabled, Is.False); | ||
| } | ||
|
|
@@ -2950,14 +2950,14 @@ public void Editor_LeavingPlayMode_DestroysAllActionStates() | |
| InputSystem.AddDevice<Gamepad>(); | ||
|
|
||
| // Enter play mode. | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
|
|
||
| // This simulates enabling project-wide actions, which is done before just before entering play mode, | ||
| // called from InputSystem.InitializeInEditor(). | ||
| if (InputSystem.actions) | ||
| InputSystem.actions.Enable(); | ||
|
|
||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
|
|
||
| DisableProjectWideActions(); | ||
|
|
||
|
|
@@ -2969,8 +2969,8 @@ public void Editor_LeavingPlayMode_DestroysAllActionStates() | |
| Assert.That(InputSystem.manager.m_StateChangeMonitors[0].count, Is.EqualTo(1)); | ||
|
|
||
| // Exit play mode. | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredEditMode); | ||
|
|
||
| Assert.That(InputActionState.s_GlobalState.globalList.length, Is.Zero); | ||
| // Won't get removed, just cleared. | ||
|
|
@@ -2984,8 +2984,8 @@ public void Editor_LeavingPlayMode_RemovesAllInputUsersAndStopsListeningForUnpai | |
| var gamepad = InputSystem.AddDevice<Gamepad>(); | ||
|
|
||
| // Enter play mode. | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
|
|
||
| var user = InputUser.PerformPairingWithDevice(gamepad); | ||
| ++InputUser.listenForUnpairedDeviceActivity; | ||
|
|
@@ -2995,8 +2995,8 @@ public void Editor_LeavingPlayMode_RemovesAllInputUsersAndStopsListeningForUnpai | |
| Assert.That(InputUser.all, Has.Count.EqualTo(1)); | ||
|
|
||
| // Exit play mode. | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredEditMode); | ||
|
|
||
| Assert.That(user.valid, Is.False); | ||
| Assert.That(InputUser.all, Has.Count.Zero); | ||
|
|
@@ -3022,7 +3022,7 @@ public void Editor_LeavingPlayMode_ReenablesAllDevicesTemporarilyDisabledDueToFo | |
|
|
||
| Assert.That(gamepad.enabled, Is.False); | ||
|
|
||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
|
|
||
| Assert.That(gamepad.enabled, Is.True); | ||
| Assert.That(gamepad.disabledWhileInBackground, Is.False); | ||
|
|
@@ -3092,15 +3092,15 @@ private void AssertAssetIsUnmodifiedAfterExitingPlayMode(Action<InputActionAsset | |
| AssetDatabase.TryGetGUIDAndLocalFileIdentifier(asset, out var assetGuid, out long _); | ||
|
|
||
| // Enter play mode. | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredPlayMode); | ||
|
|
||
| asset = AssetDatabase.LoadAssetAtPath<InputActionAsset>(m_TestAssetPath); | ||
| action?.Invoke(asset); | ||
|
|
||
| // Exit play mode. | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystem.OnPlayModeChange(PlayModeStateChange.EnteredEditMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.ExitingPlayMode); | ||
| InputSystemEditorInitializer.OnPlayModeChange(PlayModeStateChange.EnteredEditMode); | ||
|
|
||
| var actualAsset = AssetDatabase.LoadAssetAtPath<InputActionAsset>(m_TestAssetPath); | ||
| Assert.That(actualAsset.ToJson(), Is.EqualTo(originalJson), message); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -268,13 +268,8 @@ public void Remote_ResettingDevice_WillSendChangeToRemotes() | |
| public void Remote_CanConnectInputSystemsOverEditorPlayerConnection() | ||
| { | ||
| #if UNITY_EDITOR | ||
| // In the editor, RemoteInputPlayerConnection is a scriptable singleton. Creating multiple instances of it | ||
| // will cause an error messages - but will work nevertheless, so we expect those errors to let us run the test. | ||
| // We call RemoteInputPlayerConnection.instance once to make sure that we an instance is created, and we get | ||
| // a deterministic number of two errors. | ||
| var instance = RemoteInputPlayerConnection.instance; | ||
| UnityEngine.TestTools.LogAssert.Expect(LogType.Error, "ScriptableSingleton already exists. Did you query the singleton in a constructor?"); | ||
| UnityEngine.TestTools.LogAssert.Expect(LogType.Error, "ScriptableSingleton already exists. Did you query the singleton in a constructor?"); | ||
| // Ensure the singleton is initialized deterministically in editor. | ||
| _ = RemoteInputPlayerConnection.instance; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the the underscore thing here in this expression? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly, most commonly seen in in inline lambdas though. This looks very odd. Why do we need for this "singleton" to instantiate on this row? It seems like it's created below. Is there some brittle design that might need addressing here? |
||
| #endif | ||
| var connectionToEditor = ScriptableObject.CreateInstance<RemoteInputPlayerConnection>(); | ||
| var connectionToPlayer = ScriptableObject.CreateInstance<RemoteInputPlayerConnection>(); | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why pass the InputSystem/Runtime/ when it seems to always be part of the arg? Either pass the full path or only pass the relevant part IMO since concatenated on line 220. Also would prefer
Path.Combinebut maybe its irrelevant.