From 8ca51bb8f47e6fb75b62d3af636a5e1643f7356c Mon Sep 17 00:00:00 2001 From: "Simon (Darkside) Jackson" Date: Sun, 12 Jul 2026 12:36:20 +0100 Subject: [PATCH 1/3] Push testing to validate 5,6,7 --- .github/workflows/development-buildandtestupmrelease.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/development-buildandtestupmrelease.yml b/.github/workflows/development-buildandtestupmrelease.yml index 42d05b2..b59513c 100644 --- a/.github/workflows/development-buildandtestupmrelease.yml +++ b/.github/workflows/development-buildandtestupmrelease.yml @@ -36,6 +36,9 @@ jobs: - '6000.1' - '6000.2' - '6000.3' + - '6000.5' + - '6000.6' + - '6000.7' include: - os: ubuntu-latest build-targets: StandaloneLinux64, Android From ba6c5a51f684c5de1dd8d23db14054650f39fbbb Mon Sep 17 00:00:00 2001 From: "Simon (Darkside) Jackson" Date: Mon, 20 Jul 2026 14:00:10 +0100 Subject: [PATCH 2/3] 6.5 patch --- Editor/CanvasGroupActivator.cs | 4 ++++ Editor/UIExtensionsMenuOptions.cs | 14 ++++++++++- .../ColorPicker/ColorPickerPresets.cs | 8 +++++-- .../ColorPicker/Events/HSVChangedEvent.cs | 4 +++- .../ReorderableList/ReorderableListDebug.cs | 4 ++++ .../Controls/SelectionBox/SelectionBox.cs | 23 +++++++++++-------- .../ToolTips/BoundTooltip/BoundTooltipItem.cs | 4 ++++ Runtime/Scripts/ToolTips/ToolTip.cs | 4 ++++ Runtime/Scripts/Utilities/ExtensionMethods.cs | 8 +++++-- 9 files changed, 58 insertions(+), 15 deletions(-) diff --git a/Editor/CanvasGroupActivator.cs b/Editor/CanvasGroupActivator.cs index 99cb48e..06641dd 100644 --- a/Editor/CanvasGroupActivator.cs +++ b/Editor/CanvasGroupActivator.cs @@ -29,7 +29,11 @@ void OnFocus() void ObtainCanvasGroups() { +#if UNITY_6000_5_OR_NEWER + canvasGroups = FindObjectsByType(); +#else canvasGroups = GameObject.FindObjectsByType(FindObjectsSortMode.None); +#endif } void OnGUI() diff --git a/Editor/UIExtensionsMenuOptions.cs b/Editor/UIExtensionsMenuOptions.cs index 52c8b6c..ae1e346 100644 --- a/Editor/UIExtensionsMenuOptions.cs +++ b/Editor/UIExtensionsMenuOptions.cs @@ -157,14 +157,18 @@ private static void CreateEventSystem(bool select) private static void CreateEventSystem(bool select, GameObject parent) { +#if UNITY_6000_5_OR_NEWER + var esys = Object.FindAnyObjectByType(); +#else var esys = Object.FindFirstObjectByType(); +#endif if (esys == null) { var eventSystem = new GameObject("EventSystem"); GameObjectUtility.SetParentAndAlign(eventSystem, parent); esys = eventSystem.AddComponent(); #if NEW_INPUT_SYSTEM - eventSystem.AddComponent(); + eventSystem.AddComponent(); #else eventSystem.AddComponent(); #endif @@ -189,7 +193,11 @@ static public GameObject GetOrCreateCanvasGameObject() return canvas.gameObject; // No canvas in selection or its parents? Then use just any canvas.. +#if UNITY_6000_5_OR_NEWER + canvas = Object.FindAnyObjectByType(); +#else canvas = Object.FindFirstObjectByType(); +#endif if (canvas != null && canvas.gameObject.activeInHierarchy) return canvas.gameObject; @@ -1250,7 +1258,11 @@ private static void CreateToolTipItem(bool select) private static void CreateToolTipItem(bool select, GameObject parent) { +#if UNITY_6000_5_OR_NEWER + var btti = Object.FindAnyObjectByType(); +#else var btti = Object.FindFirstObjectByType(); +#endif if (btti == null) { var boundTooltipItem = CreateUIObject("ToolTipItem", parent.GetComponentInParent().gameObject); diff --git a/Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs b/Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs index c0bcdbd..62ba10d 100644 --- a/Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs +++ b/Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs @@ -35,7 +35,11 @@ public virtual string JsonFilePath protected virtual void Reset() { +#if UNITY_6000_5_OR_NEWER + playerPrefsKey = "colorpicker_" + GetEntityId().ToString(); +#else playerPrefsKey = "colorpicker_" + GetInstanceID().ToString(); +#endif } protected virtual void Awake() @@ -75,7 +79,7 @@ public virtual void LoadPresets(SaveType saveType) break; default: throw new System.NotImplementedException(saveType.ToString()); - } + } if (!string.IsNullOrEmpty(jsonData)) { @@ -159,7 +163,7 @@ public virtual void CreatePreset(Color color, bool loading) newPresetButton.transform.SetAsLastSibling(); newPresetButton.SetActive(true); newPresetButton.GetComponent().color = color; - + createPresetImage.color = Color.white; if (!loading) diff --git a/Runtime/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs b/Runtime/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs index d7d573a..48f96e6 100644 --- a/Runtime/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs +++ b/Runtime/Scripts/Controls/ColorPicker/Events/HSVChangedEvent.cs @@ -1,7 +1,9 @@ -using UnityEngine.Events; +using System; +using UnityEngine.Events; namespace UnityEngine.UI.Extensions.ColorPicker { + [Serializable] public class HSVChangedEvent : UnityEvent { diff --git a/Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs b/Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs index 8277e9e..5f29ecc 100644 --- a/Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs +++ b/Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs @@ -10,7 +10,11 @@ public class ReorderableListDebug : MonoBehaviour void Awake() { +#if UNITY_6000_5_OR_NEWER + foreach (var list in FindObjectsByType()) +#else foreach (var list in FindObjectsByType(FindObjectsSortMode.None)) +#endif { list.OnElementDropped.AddListener(ElementDropped); } diff --git a/Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs b/Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs index b890a84..427cecc 100644 --- a/Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs +++ b/Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs @@ -66,6 +66,7 @@ public class SelectionBox : MonoBehaviour private IBoxSelectable clickedAfterDrag; //Custom UnityEvent so we can add Listeners to this instance when Selections are changed. + [System.Serializable] public class SelectionEvent : UnityEvent { } public SelectionEvent onSelectionChange = new SelectionEvent(); @@ -181,7 +182,11 @@ void BeginSelection() // If we do not have a group of selectables already set, we'll just loop through every object that's a monobehaviour, and look for selectable interfaces in them if (selectableGroup == null) { +#if UNITY_6000_5_OR_NEWER + behavioursToGetSelectionsFrom = GameObject.FindObjectsByType(); +#else behavioursToGetSelectionsFrom = GameObject.FindObjectsByType(FindObjectsSortMode.None); +#endif } else { @@ -313,7 +318,7 @@ void DragSelection() boxRect.anchoredPosition = startPoint; boxRect.sizeDelta = difference; - //Then we check our list of Selectables to see if they're being preselected or not. + // Then we check our list of Selectables to see if they're being preselected or not. foreach (var selectable in selectables) { @@ -387,14 +392,14 @@ Vector2 GetScreenPointOfSelectable(IBoxSelectable selectable) } - /* - * Finding the camera used to calculate the screenPoint of an object causes a couple of problems: - * - * If it has a rectTransform, the root Canvas that the rectTransform is a descendant of will give unusable - * screen points depending on the Canvas.RenderMode, if we don't do any further calculation. - * - * This function solves that problem. - */ + /// + /// Finding the camera used to calculate the screenPoint of an object causes a couple of problems: + /// If it has a rectTransform, the root Canvas that the rectTransform is a descendant of will give unusable + /// screen points depending on the Canvas.RenderMode, if we don't do any further calculation. + /// This function solves that problem. + /// + /// + /// Camera GetScreenPointCamera(RectTransform rectTransform) { diff --git a/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs b/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs index a9fbf96..c7c5761 100644 --- a/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs +++ b/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs @@ -47,7 +47,11 @@ public static BoundTooltipItem Instance { if (instance == null) { +#if UNITY_6000_5_OR_NEWER + instance = FindAnyObjectByType(); +#else instance = GameObject.FindFirstObjectByType(); +#endif } return instance; } diff --git a/Runtime/Scripts/ToolTips/ToolTip.cs b/Runtime/Scripts/ToolTips/ToolTip.cs index 3c8e0e5..5a0ed41 100644 --- a/Runtime/Scripts/ToolTips/ToolTip.cs +++ b/Runtime/Scripts/ToolTips/ToolTip.cs @@ -91,7 +91,11 @@ public static ToolTip Instance { if (instance == null) { +#if UNITY_6000_5_OR_NEWER + instance = FindAnyObjectByType(); +#else instance = FindFirstObjectByType(); +#endif } return instance; } diff --git a/Runtime/Scripts/Utilities/ExtensionMethods.cs b/Runtime/Scripts/Utilities/ExtensionMethods.cs index 8afe3f0..b539187 100644 --- a/Runtime/Scripts/Utilities/ExtensionMethods.cs +++ b/Runtime/Scripts/Utilities/ExtensionMethods.cs @@ -24,10 +24,14 @@ public static bool IsPrefab(this GameObject gameObject) return !gameObject.scene.IsValid() && !gameObject.scene.isLoaded && +#if UNITY_6000_5_OR_NEWER + gameObject.GetEntityId().IsValid() && +#else gameObject.GetInstanceID() >= 0 && +#endif // I noticed that ones with IDs under 0 were objects I didn't recognize !gameObject.hideFlags.HasFlag(HideFlags.HideInHierarchy); - // I don't care about GameObjects *inside* prefabs, just the overall prefab. + // I don't care about GameObjects *inside* prefabs, just the overall prefab. } /// @@ -46,7 +50,7 @@ public static T Clamp(this T value, T min, T max) where T : IComparable } if (value.CompareTo(max) > 0) { - value = max; + value = max; } return value; From 05b6fa92daf1eeed51c60f4ecf35cbe3d006f6b6 Mon Sep 17 00:00:00 2001 From: "Simon (Darkside) Jackson" Date: Mon, 20 Jul 2026 15:08:32 +0100 Subject: [PATCH 3/3] Patch Unity6.6/7 --- Examples~ | 2 +- Runtime/Scripts/Controls/UIGraphicSector/Sector.cs | 2 ++ Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs | 3 +++ Runtime/Scripts/Layout/FlowLayoutGroup.cs | 12 ++++++++++++ Runtime/Scripts/Layout/TableLayoutGroup.cs | 9 ++++++++- Runtime/Scripts/Primitives/UIPrimitiveBase.cs | 12 +++++++++++- 6 files changed, 37 insertions(+), 3 deletions(-) diff --git a/Examples~ b/Examples~ index 4b7b0c0..bfcb776 160000 --- a/Examples~ +++ b/Examples~ @@ -1 +1 @@ -Subproject commit 4b7b0c010808170542403a649faf40d4ed1d20de +Subproject commit bfcb7766eada96934a13ba48f89ce99bc64d7327 diff --git a/Runtime/Scripts/Controls/UIGraphicSector/Sector.cs b/Runtime/Scripts/Controls/UIGraphicSector/Sector.cs index da1010f..746c587 100644 --- a/Runtime/Scripts/Controls/UIGraphicSector/Sector.cs +++ b/Runtime/Scripts/Controls/UIGraphicSector/Sector.cs @@ -98,7 +98,9 @@ public float pixelsPerUnit public float multipliedPixelsPerUnit => pixelsPerUnit * Settings.PixelsPerUnitMultiplier; +#if !UNITY_6000_6_OR_NEWER protected Sector() => useLegacyMeshGeneration = false; +#endif protected override void OnEnable() { diff --git a/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs b/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs index 3a555bf..e574d38 100644 --- a/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs +++ b/Runtime/Scripts/Effects/CurlyUI/CUIGraphic.cs @@ -512,6 +512,9 @@ public void ReferenceCUIForBCurves() // use tangent and start and end time to derive control point 2 and 3 } +#if UNITY_6000_6_OR_NEWER + [System.Obsolete("Use Refresh() instead.")] +#endif public override void ModifyMesh(Mesh _mesh) { diff --git a/Runtime/Scripts/Layout/FlowLayoutGroup.cs b/Runtime/Scripts/Layout/FlowLayoutGroup.cs index a949d0c..05e679e 100644 --- a/Runtime/Scripts/Layout/FlowLayoutGroup.cs +++ b/Runtime/Scripts/Layout/FlowLayoutGroup.cs @@ -44,7 +44,11 @@ public override void CalculateLayoutInputHorizontal() { base.CalculateLayoutInputHorizontal(); var minWidth = GetGreatestMinimumChildWidth() + padding.left + padding.right; +#if UNITY_6000_6_OR_NEWER + SetLayoutInputForAxis(minWidth, -1, -1, 0, 0); +#else SetLayoutInputForAxis(minWidth, -1, -1, 0); +#endif } else { @@ -73,7 +77,11 @@ public override void CalculateLayoutInputVertical() { base.CalculateLayoutInputHorizontal(); var minHeight = GetGreatestMinimumChildHeigth() + padding.bottom + padding.top; +#if UNITY_6000_6_OR_NEWER + SetLayoutInputForAxis(minHeight, -1, -1, 1, 1); +#else SetLayoutInputForAxis(minHeight, -1, -1, 1); +#endif } } @@ -274,7 +282,11 @@ public float SetLayout(int axis, bool layoutInput) if (layoutInput) { +#if UNITY_6000_6_OR_NEWER + SetLayoutInputForAxis(offset, offset, -1, axis, 0); +#else SetLayoutInputForAxis(offset, offset, -1, axis); +#endif } return offset; } diff --git a/Runtime/Scripts/Layout/TableLayoutGroup.cs b/Runtime/Scripts/Layout/TableLayoutGroup.cs index 663857f..9e53a74 100644 --- a/Runtime/Scripts/Layout/TableLayoutGroup.cs +++ b/Runtime/Scripts/Layout/TableLayoutGroup.cs @@ -120,8 +120,11 @@ public override void CalculateLayoutInputHorizontal() } horizontalSize -= columnSpacing; - +#if UNITY_6000_6_OR_NEWER + SetLayoutInputForAxis(horizontalSize, horizontalSize, 0, 0, 0); +#else SetLayoutInputForAxis(horizontalSize, horizontalSize, 0, 0); +#endif } public override void CalculateLayoutInputVertical() @@ -183,7 +186,11 @@ public override void CalculateLayoutInputVertical() } totalPreferredHeight = Mathf.Max(totalMinHeight, totalPreferredHeight); +#if UNITY_6000_6_OR_NEWER + SetLayoutInputForAxis(totalMinHeight, totalPreferredHeight, 1, 1, 1); +#else SetLayoutInputForAxis(totalMinHeight, totalPreferredHeight, 1, 1); +#endif } public override void SetLayoutHorizontal() diff --git a/Runtime/Scripts/Primitives/UIPrimitiveBase.cs b/Runtime/Scripts/Primitives/UIPrimitiveBase.cs index 0c8ef11..ec81bb7 100644 --- a/Runtime/Scripts/Primitives/UIPrimitiveBase.cs +++ b/Runtime/Scripts/Primitives/UIPrimitiveBase.cs @@ -43,7 +43,9 @@ public class UIPrimitiveBase : MaskableGraphic, ILayoutElement, ICanvasRaycastFi protected UIPrimitiveBase() { +#if !UNITY_6000_6_OR_NEWER useLegacyMeshGeneration = false; +#endif } /// @@ -241,6 +243,14 @@ public virtual float preferredHeight public virtual int layoutPriority { get { return 0; } } +#if UNITY_6000_6_OR_NEWER + /// + public virtual float maxWidth { get { return LayoutUtility.DefaultMaxSize; } } + + /// + public virtual float maxHeight { get { return LayoutUtility.DefaultMaxSize; } } +#endif + #endregion #region ICanvasRaycastFilter Interface @@ -297,7 +307,7 @@ private Vector2 MapCoordinate(Vector2 local, Rect rect) { Rect spriteRect = sprite.rect; //if (type == Type.Simple || type == Type.Filled) - return new Vector2(local.x * rect.width, local.y * rect.height); + return new Vector2(local.x * rect.width, local.y * rect.height); //Vector4 border = sprite.border; //Vector4 adjustedBorder = GetAdjustedBorders(border / pixelsPerUnit, rect);