From 162e4d3ed9c2933abfd1b47a427f055a29b002fb Mon Sep 17 00:00:00 2001 From: SimonDarksideJ Date: Thu, 23 Nov 2023 20:32:53 +0000 Subject: [PATCH] Updated implementations to handle 2023 support, with 2023 moving in to public release --- .../workflows/rununitybuildmultiversion.yml | 20 +++++++++++++++---- Editor/CanvasGroupActivator.cs | 4 ++++ Editor/UIExtensionsMenuOptions.cs | 16 +++++++++++++-- .../Scripts/Controls/ComboBox/DropDownList.cs | 6 +++--- .../ReorderableList/ReorderableListDebug.cs | 4 ++++ .../Controls/SelectionBox/SelectionBox.cs | 4 ++++ .../ToolTips/BoundTooltip/BoundTooltipItem.cs | 6 ++++++ Runtime/Scripts/ToolTips/ToolTip.cs | 6 ++++++ 8 files changed, 57 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rununitybuildmultiversion.yml b/.github/workflows/rununitybuildmultiversion.yml index ffd309c..ee228ee 100644 --- a/.github/workflows/rununitybuildmultiversion.yml +++ b/.github/workflows/rununitybuildmultiversion.yml @@ -52,17 +52,29 @@ jobs: unityVersion: 2021.3 build-target: WSAPlayer - os: windows - unityVersion: 2022.2 + unityVersion: 2022.3 build-target: Android - os: macOS - unityVersion: 2022.2 + unityVersion: 2022.3 build-target: iOS - os: windows - unityVersion: 2022.2 + unityVersion: 2022.3 build-target: StandaloneWindows64 - os: windows - unityVersion: 2022.2 + unityVersion: 2022.3 build-target: WSAPlayer + - os: windows + unityVersion: 2023.1 + build-target: Android + - os: macOS + unityVersion: 2023.1 + build-target: iOS + - os: windows + unityVersion: 2023.1 + build-target: StandaloneWindows64 + - os: windows + unityVersion: 2023.1 + build-target: WSAPlayer steps: - name: Script Version run: | diff --git a/Editor/CanvasGroupActivator.cs b/Editor/CanvasGroupActivator.cs index 5730bb6..cd71657 100644 --- a/Editor/CanvasGroupActivator.cs +++ b/Editor/CanvasGroupActivator.cs @@ -29,7 +29,11 @@ namespace UnityEngine.UI.Extensions void ObtainCanvasGroups() { +#if UNITY_2023_1_OR_NEWER + canvasGroups = GameObject.FindObjectsByType(FindObjectsSortMode.None); +#else canvasGroups = GameObject.FindObjectsOfType(); +#endif } void OnGUI() diff --git a/Editor/UIExtensionsMenuOptions.cs b/Editor/UIExtensionsMenuOptions.cs index 75711d6..ac4bbe4 100644 --- a/Editor/UIExtensionsMenuOptions.cs +++ b/Editor/UIExtensionsMenuOptions.cs @@ -159,7 +159,11 @@ namespace UnityEditor.UI private static void CreateEventSystem(bool select, GameObject parent) { +#if UNITY_2023_1_OR_NEWER + var esys = Object.FindFirstObjectByType(); +#else var esys = Object.FindObjectOfType(); +#endif if (esys == null) { var eventSystem = new GameObject("EventSystem"); @@ -191,7 +195,11 @@ namespace UnityEditor.UI return canvas.gameObject; // No canvas in selection or its parents? Then use just any canvas.. +#if UNITY_2023_1_OR_NEWER + canvas = Object.FindFirstObjectByType(); +#else canvas = Object.FindObjectOfType(typeof(Canvas)) as Canvas; +#endif if (canvas != null && canvas.gameObject.activeInHierarchy) return canvas.gameObject; @@ -1121,7 +1129,7 @@ namespace UnityEditor.UI mainButtonRT.anchorMin = Vector2.zero; mainButtonRT.anchorMax = Vector2.one; mainButtonRT.sizeDelta = Vector2.zero; - Events.UnityEventTools.AddBoolPersistentListener(mainButton.GetComponent