From 778376ebde69e1262ddae4214bd8b58decdccfe4 Mon Sep 17 00:00:00 2001 From: James McGill Date: Wed, 22 Nov 2023 18:06:03 +0100 Subject: [PATCH 1/6] Make TreeView generic --- .../InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs | 2 ++ .../InputSystem/Editor/AssetEditor/InputActionTreeView.cs | 3 +++ .../InputSystem/Editor/AssetEditor/InputActionTreeViewItems.cs | 1 + .../InputSystem/Editor/Debugger/InputDebuggerWindow.cs | 3 +++ .../InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs | 1 + .../InputSystem/Editor/Internal/InputControlTreeView.cs | 3 +++ .../InputSystem/Editor/Internal/InputEventTreeView.cs | 3 +++ .../InputSystem/Editor/Internal/InputStateWindow.cs | 1 + .../InputSystem/Editor/Internal/TreeViewHelpers.cs | 2 ++ .../InputSystem/Editor/PropertyDrawers/InputActionDrawer.cs | 1 + .../Editor/PropertyDrawers/InputActionDrawerBase.cs | 1 + .../InputSystem/Editor/PropertyDrawers/InputActionMapDrawer.cs | 1 + .../InputSystem/Plugins/HID/HIDDescriptorWindow.cs | 3 +++ 13 files changed, 25 insertions(+) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs index 3453e78351..5c490fd06b 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs @@ -7,6 +7,8 @@ using UnityEditor.Callbacks; using UnityEditor.IMGUI.Controls; using UnityEditor.ShortcutManagement; +using TreeView = UnityEditor.IMGUI.Controls.TreeView; +using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState; ////TODO: Add "Revert" button diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs index 08640c0d42..b2bd2a0a4b 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeView.cs @@ -9,6 +9,9 @@ using UnityEditor.IMGUI.Controls; using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.Utilities; +using TreeView = UnityEditor.IMGUI.Controls.TreeView; +using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; // The action tree view illustrates one of the weaknesses of Unity's editing model. While operating directly // on serialized data does have a number of advantages (the built-in undo system being one of them), making the diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeViewItems.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeViewItems.cs index 6aa8300d9f..c554c4177e 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeViewItems.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionTreeViewItems.cs @@ -5,6 +5,7 @@ using UnityEditor; using UnityEditor.IMGUI.Controls; using UnityEngine.InputSystem.Utilities; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; ////TODO: sync expanded state of SerializedProperties to expanded state of tree (will help preserving expansion in inspector) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs index 0c78401a10..bcd690e3c7 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs @@ -11,6 +11,9 @@ using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.Users; using UnityEngine.InputSystem.Utilities; +using TreeView = UnityEditor.IMGUI.Controls.TreeView; +using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; ////FIXME: Generate proper IDs for the individual tree view items; the current sequential numbering scheme just causes lots of //// weird expansion/collapsing to happen. diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs index d38943abc8..223245dad5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs @@ -6,6 +6,7 @@ using UnityEditor.IMGUI.Controls; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; +using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState; ////TODO: allow selecting events and saving out only the selected ones diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputControlTreeView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputControlTreeView.cs index 620d9ced20..7d9ba0e9e4 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputControlTreeView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputControlTreeView.cs @@ -5,6 +5,9 @@ using UnityEditor.IMGUI.Controls; using UnityEngine.InputSystem.LowLevel; using UnityEngine.Profiling; +using TreeView = UnityEditor.IMGUI.Controls.TreeView; +using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; ////TODO: make control values editable (create state events from UI and pump them into the system) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputEventTreeView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputEventTreeView.cs index 4e6e07ef6c..4cdaf9395e 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputEventTreeView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputEventTreeView.cs @@ -5,6 +5,9 @@ using UnityEngine.InputSystem.LowLevel; using UnityEditor; using UnityEngine.Profiling; +using TreeView = UnityEditor.IMGUI.Controls.TreeView; +using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; ////FIXME: this performs horribly; the constant rebuilding on every single event makes the debug view super slow when device is noisy diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs index 8376792d48..b6fcfc6476 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/InputStateWindow.cs @@ -5,6 +5,7 @@ using UnityEditor; using UnityEditor.IMGUI.Controls; using UnityEngine.InputSystem.LowLevel; +using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState; ////TODO: add ability to single-step through events diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/TreeViewHelpers.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/TreeViewHelpers.cs index 9e6ea9caf7..b929a38a40 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/TreeViewHelpers.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Internal/TreeViewHelpers.cs @@ -1,6 +1,8 @@ #if UNITY_EDITOR using System; using UnityEditor.IMGUI.Controls; +using TreeView = UnityEditor.IMGUI.Controls.TreeView; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; namespace UnityEngine.InputSystem.Editor { diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawer.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawer.cs index 7662d294a5..c05f85c1b2 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawer.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawer.cs @@ -2,6 +2,7 @@ using System; using UnityEditor; using UnityEditor.IMGUI.Controls; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; namespace UnityEngine.InputSystem.Editor { diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawerBase.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawerBase.cs index a817161c6c..d8b69e40f5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawerBase.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionDrawerBase.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using UnityEditor; using UnityEditor.IMGUI.Controls; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; namespace UnityEngine.InputSystem.Editor { diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionMapDrawer.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionMapDrawer.cs index 50e5d45943..d99f0208ed 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionMapDrawer.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionMapDrawer.cs @@ -2,6 +2,7 @@ using System; using UnityEditor; using UnityEditor.IMGUI.Controls; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; namespace UnityEngine.InputSystem.Editor { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HIDDescriptorWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HIDDescriptorWindow.cs index a5b5f7bf4b..d8fb99debc 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HIDDescriptorWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HIDDescriptorWindow.cs @@ -5,6 +5,9 @@ using UnityEditor.IMGUI.Controls; using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.LowLevel; +using TreeView = UnityEditor.IMGUI.Controls.TreeView; +using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState; +using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem; ////TODO: use two columns for treeview and separate name and value From eb28d83cb3a3854163239a6ca3893bb698fc119a Mon Sep 17 00:00:00 2001 From: James McGill Date: Wed, 22 Nov 2023 19:11:47 +0100 Subject: [PATCH 2/6] Fix warning --- .../InputSystem/Plugins/PlayerInput/PlayerInput.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs index e541036e9e..cf5ea7cb61 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs @@ -719,12 +719,7 @@ public event Action onControlsChanged /// /// Associating a camera with a player is necessary only when using split-screen (see ). /// - public - #if UNITY_EDITOR - // camera property is deprecated and only available in Editor. - new - #endif - Camera camera + public Camera camera { get => m_Camera; set => m_Camera = value; From a2844c89667a3a744a4769bca7445d5e2bf138b6 Mon Sep 17 00:00:00 2001 From: James McGill Date: Wed, 22 Nov 2023 19:12:55 +0100 Subject: [PATCH 3/6] Fix warning by removing UNITY_64 --- .../com.unity.inputsystem/InputSystem/Plugins/HID/HID.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HID.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HID.cs index 6be81a61cd..7505f7b4c1 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HID.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HID.cs @@ -12,11 +12,6 @@ using UnityEngine.Pool; #endif -// HID support is currently broken in 32-bit Windows standalone players. Consider 32bit Windows players unsupported for now. -#if UNITY_STANDALONE_WIN && !UNITY_64 -#warning The 32-bit Windows player is not currently supported by the Input System. HID input will not work in the player. Please use x86_64, if possible. -#endif - ////REVIEW: there will probably be lots of cases where the HID device creation process just needs a little tweaking; we should //// have better mechanism to do that without requiring to replace the entire process wholesale From f261f17f550ed73c309868c95dcbe0f0a52f7a2c Mon Sep 17 00:00:00 2001 From: James McGill Date: Wed, 22 Nov 2023 19:37:32 +0100 Subject: [PATCH 4/6] Manifest updates --- Packages/manifest.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index f1572397b2..6a90597014 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -3,12 +3,10 @@ "com.unity.analytics": "3.6.12", "com.unity.cinemachine": "2.3.4", "com.unity.coding": "0.1.0-preview.24", - "com.unity.ide.rider": "1.2.1", "com.unity.ide.visualstudio": "2.0.15", - "com.unity.probuilder": "4.2.3", "com.unity.settings-manager": "1.0.3", "com.unity.test-framework": "1.1.33", - "com.unity.test-framework.build": "0.0.1-preview.12", + "com.unity.test-framework.build": "0.0.1-preview.15", "com.unity.test-framework.performance": "3.0.2", "com.unity.test-framework.utp-reporter": "1.1.0-preview", "com.unity.textmeshpro": "2.1.4", From 4127f210987966a6c07afbc362040bdf183e060e Mon Sep 17 00:00:00 2001 From: James McGill Date: Thu, 23 Nov 2023 12:40:41 +0100 Subject: [PATCH 5/6] fix error --- .../InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs | 2 +- .../Editor/UITKAssetEditor/InputActionsEditorWindow.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs index 5c490fd06b..e2baf46fc9 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetEditor/InputActionEditorWindow.cs @@ -37,7 +37,7 @@ internal class InputActionEditorWindow : EditorWindow, IDisposable /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "line", Justification = "line parameter required by OnOpenAsset attribute")] [OnOpenAsset] - public static bool OnOpenAsset(int instanceId, int line) + public static bool OnOpenAsset(InstanceID instanceId, int line) { #if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS if (!InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs index ad5b063dd0..b78b7b23e3 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/InputActionsEditorWindow.cs @@ -32,7 +32,7 @@ internal class InputActionsEditorWindow : EditorWindow static readonly Vector2 k_MinWindowSize = new Vector2(650, 450); [OnOpenAsset] - public static bool OpenAsset(int instanceId, int line) + public static bool OpenAsset(InstanceID instanceId, int line) { if (InputSystem.settings.IsFeatureEnabled(InputFeatureNames.kUseIMGUIEditorForAssets)) return false; From 396edcb61acc2de214f35c54f4c140992445ae88 Mon Sep 17 00:00:00 2001 From: James McGill Date: Thu, 23 Nov 2023 12:50:35 +0100 Subject: [PATCH 6/6] fix warning --- Assets/Samples/UnityRemote/UnityRemoteTestScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Samples/UnityRemote/UnityRemoteTestScript.cs b/Assets/Samples/UnityRemote/UnityRemoteTestScript.cs index 3c1fc77507..7505922fa5 100644 --- a/Assets/Samples/UnityRemote/UnityRemoteTestScript.cs +++ b/Assets/Samples/UnityRemote/UnityRemoteTestScript.cs @@ -7,7 +7,7 @@ public class UnityRemoteTestScript : MonoBehaviour { - public new Camera camera; + public Camera camera; public Text accelerometerInputText; public Text touchInputText;