diff --git a/.github/workflows/development-buildandtestupmrelease.yml b/.github/workflows/development-buildandtestupmrelease.yml index 42d05b25..b59513cb 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 83c2e7da..6ec7f4cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,74 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/). +## Release 3.0.0 - Unity 6, reimagined - 2026/06/19 + +The V3 relaunch brings **full Unity 6 support**, a refreshed brand, and the start of a two-package ecosystem — the proven uGUI library you know, now joined by a modern UI Toolkit companion. + +> **Two packages. One ecosystem.** These notes cover the **uGUI** package (`com.unity.uiextensions`). Meet its new companion: [UI Toolkit Extensions](https://github.com/Unity-UI-Extensions/com.unity.uitoolkitextensions). + +To get up to speed with the Unity UI Extensions, check out the [Getting Started](https://unity-ui-extensions.github.io/GettingStarted.html) Page. + +> Ways to get in touch: +> +> - [GitHub Discussions](https://github.com/Unity-UI-Extensions/com.unity.uiextensions/discussions), if you have any questions, queries or suggestions +> - [Gitter Chat](https://gitter.im/Unity-UI-Extensions/Lobby) site for the UI Extensions project +> +> Much easier that posting a question / issue on YouTube, Twitter or Facebook :D + +### Added + +- Full support for Unity 6, updating all controls and editor components for the new Unity UI framework, including compile flag support for the updated Unity 6 API (#493, #497) +- Added new GridRawImage control, applying a texture as a repeating grid on a RawImage +- Added new UI_Knob2 control, an updated take on the rotary UI Knob +- Added new UISegmentedCircle control, for drawing segmented circular UI +- Added new UI Graphic Selector control +- Added SetXWithoutNotify and SetYWithoutNotify methods to the BoxSlider, to set values without firing OnValueChanged (@Kurante2801) +- The Pivot can now be used as the reference point when drawing lines with the UILineRenderer (#490) +- Added a "close line" option to the UILineRenderer which finishes the line off with a closer to fill any gaps at the end - Resolves: #449 +- Added a new "CullingMode" option to the UI Particle System that when enabled alters the control to resolve unscaled delta time issues - Fixes #486, #487 + +### Changed + +- fix: Optimized Gradient2 when ModifyMesh is called, and it now responds to gradient key updates in both the inspector and at runtime (@bluefallsky) +- fix: Corrected the radial triangle add order (#384) (@bluefallsky) +- fix: The UILineConnector now refreshes when the global scale changes and its point array calculation has been corrected (#495) (@hugoymh) +- fix: The ReorderableList now keeps an item's rotation configuration while dragging (@JavierMonton) +- fix: Addressed a null reference exception in the ReorderableList +- fix: Resolved a stacking issue with the ReorderableList when moving elements "slightly" - Resolves: #470 +- fix: Force ScrollRect.content setup on initialization (#485) +- fix: Resolved a race condition in the ScrollSnap controls which could raise a NaN error when lerping - Resolves: #452 / #508 +- fix: Patched the HSS/VSS against a potential divide by zero error if the scroll snap has a single page +- fix: Updated GetCurrentPage on the ScrollSnaps to be more resilient - Fixes #254 +- fix: Updated the ScrollSnaps to be more resilient to rescaling and patched the full screen scroll snap RIF - Fixes #257, #260 +- fix: Resolved out of bounds issues with the Infinite scroll control - Fixes #237 +- fix: Addressed layout issues with the FlowLayoutGroup - Fixes #456 +- Layout groups updated to rebuild on disable/enable - Resolves: #468 +- Updated the UIVertical Scroller to be more efficient for Unity 6 and updated its example +- Updated the Picker control and samples to the latest version +- Removed cap points from the line renderers as they caused LOD and jagged-texture issues +- Renamed Segment to SegmentedControlSegment to avoid class name conflicts +- Updated components to maintain both Text and TextMeshPro compatibility where possible, including a debug option to allow both (#477) +- Reverted Curly Text back to the old Text component as it is not compatible with TextMeshPro - alternatives are being investigated + +### Deprecated + +- With the move to Unity 6, the old legacy Text based controls have been cleared out as they are no longer valid, along with a general script clean-up to remove legacy dependencies. For any affected component, use the TextMeshPro alternatives. + +## Additional Notes + +### [Installation Instructions](https://unity-ui-extensions.github.io/UPMInstallation.html) + +The recommended way to add the Unity UI Extensions project to your solution is to use the Unity package Manager. Simply use the Unity Package Manager to reference the project to install it + +New for 2020, we have added OpenUPM support and the package can be installed using the following [OpenUPM CLI](https://openupm.com/docs/) command: + +```cli +`openupm add com.unity.uiextensions` +``` + +> For more details on using [OpenUPM CLI, check the docs here](https://github.com/openupm/openupm-cli#installation). + ## Release 2.3.2 - Rejuvenation - 2023/11/26 2023 is certainly an interesting year to keep you on your toes, and finding time to keep managing all the requests and updates that come in are taking their toll, especially for a FREE project, but nonetheless, I still do it. @@ -27,11 +95,11 @@ For customers upgrading from earlier versions of Unity to Unity 2020, please be For more details, see the [deprecation notice](https://github.com/Unity-UI-Extensions/com.unity.uiextensions/discussions/428) on GitHub. -## Added +### Added - Add CalculatePointOnCurve for uilinerenderer (@victornor) -## Changed +### Changed - fix: Fixed an null reference exception with the ResetSelectableHighlight (@FejZa) - fix: Resolved an issue where the last line in a flow layout group would overflow the rect bounds. @@ -43,7 +111,7 @@ For more details, see the [deprecation notice](https://github.com/Unity-UI-Exten - Added extra event on the AutoCompleteComboBox, to fire when an item in the list is selected, with its display name. - FlowLayoutGroup components updated to latest (likely the last as the author has stopped development) -## Deprecated +### Deprecated - All deprecated Text based components now have "obsolete" tags, to avoid breaking code. Note, these do not function in 2022 and above, as Unity have "changed" things. For any affected component, I recommend updating to use TextMeshPro native features. diff --git a/Documentation~/com.unity.uiextensions.md b/Documentation~/com.unity.uiextensions.md index 3cdec96f..23c757e3 100644 --- a/Documentation~/com.unity.uiextensions.md +++ b/Documentation~/com.unity.uiextensions.md @@ -14,13 +14,13 @@ You can follow the UI Extensions team for updates and news on: > - [Gitter Chat](https://gitter.im/Unity-UI-Extensions/Lobby) site for the UI Extensions project > - [GitHub Discussions](https://github.com/Unity-UI-Extensions/com.unity.uiextensions/discussions), if you have any questions, queries or suggestions -# Installing Unity UI Extensions +## Installing Unity UI Extensions To install this package, follow the instructions in the Package Manager documentation. For more details on [Getting Started](https://unity-ui-extensions.github.io/GettingStarted) please checkout the [online documentation here](https://unity-ui-extensions.github.io/). -# Using Unity UI Extensions +## Using Unity UI Extensions The UI Extensions project provides many automated functions to add the various controls contained within the project commonly accessed via "***GameObject -> UI -> Extensions -> 'Control'***" from the editor menu. This will add the UI object and all the necessary components to make that control work in the scene in a default state. @@ -28,7 +28,7 @@ Some of the features are also available through the GameObject "Add Component" m For a full list of the controls and how they are used, please see the [online documentation](https://unity-ui-extensions.github.io/Controls.html) for the project. -# Technical details +## Technical details ## Requirements @@ -42,11 +42,11 @@ This version of the Unity UI Extensions is compatible with the following version ## [Release Notes](https://unity-ui-extensions.github.io/ReleaseNotes/RELEASENOTES) -## Release 2.3.2 - Rejuvenation - 2023/11/26 +## Release 3.0.0 - Unity 6, reimagined - 2026/06/19 -2023 is certainly an interesting year to keep you on your toes, and finding time to keep managing all the requests and updates that come in are taking their toll, especially for a FREE project, but nonetheless, I still do it. +The V3 relaunch brings **full Unity 6 support**, a refreshed brand, and the start of a two-package ecosystem — the proven uGUI library you know, now joined by a modern UI Toolkit companion. -Mainly bugfixes for the end of year update, promoting some resolutions that have been verified and tested since the last release. +> **Two packages. One ecosystem.** These notes cover the **uGUI** package (`com.unity.uiextensions`). Meet its new companion: [UI Toolkit Extensions](https://github.com/Unity-UI-Extensions/com.unity.uitoolkitextensions). To get up to speed with the Unity UI Extensions, check out the [Getting Started](https://unity-ui-extensions.github.io/GettingStarted.html) Page. @@ -57,33 +57,58 @@ To get up to speed with the Unity UI Extensions, check out the [Getting Started] > > Much easier that posting a question / issue on YouTube, Twitter or Facebook :D -## Breaking changes +### Added -For customers upgrading from earlier versions of Unity to Unity 2020, please be aware of the Breaking change related to Text Based components. You will need to manually replace any UI using the older ```Text``` component and replace them with ```TextMeshPro``` versions. This is unavoidable due to Unity deprecating the Text component. +- Full support for Unity 6, updating all controls and editor components for the new Unity UI framework, including compile flag support for the updated Unity 6 API (#493, #497) +- Added new GridRawImage control, applying a texture as a repeating grid on a RawImage +- Added new UI_Knob2 control, an updated take on the rotary UI Knob +- Added new UISegmentedCircle control, for drawing segmented circular UI +- Added new UI Graphic Selector control +- Added SetXWithoutNotify and SetYWithoutNotify methods to the BoxSlider, to set values without firing OnValueChanged (@Kurante2801) +- The Pivot can now be used as the reference point when drawing lines with the UILineRenderer (#490) +- Added a "close line" option to the UILineRenderer which finishes the line off with a closer to fill any gaps at the end - Resolves: #449 +- Added a new "CullingMode" option to the UI Particle System that when enabled alters the control to resolve unscaled delta time issues - Fixes #486, #487 -> New users to 2022 are unaffected as all the Editor commands have been updated to use the newer TextMeshPro versions. +### Changed -For more details, see the [deprecation notice](https://github.com/Unity-UI-Extensions/com.unity.uiextensions/discussions/428) on GitHub. +- fix: Optimized Gradient2 when ModifyMesh is called, and it now responds to gradient key updates in both the inspector and at runtime (@bluefallsky) +- fix: Corrected the radial triangle add order (#384) (@bluefallsky) +- fix: The UILineConnector now refreshes when the global scale changes and its point array calculation has been corrected (#495) (@hugoymh) +- fix: The ReorderableList now keeps an item's rotation configuration while dragging (@JavierMonton) +- fix: Addressed a null reference exception in the ReorderableList +- fix: Resolved a stacking issue with the ReorderableList when moving elements "slightly" - Resolves: #470 +- fix: Force ScrollRect.content setup on initialization (#485) +- fix: Resolved a race condition in the ScrollSnap controls which could raise a NaN error when lerping - Resolves: #452 / #508 +- fix: Patched the HSS/VSS against a potential divide by zero error if the scroll snap has a single page +- fix: Updated GetCurrentPage on the ScrollSnaps to be more resilient - Fixes #254 +- fix: Updated the ScrollSnaps to be more resilient to rescaling and patched the full screen scroll snap RIF - Fixes #257, #260 +- fix: Resolved out of bounds issues with the Infinite scroll control - Fixes #237 +- fix: Addressed layout issues with the FlowLayoutGroup - Fixes #456 +- Layout groups updated to rebuild on disable/enable - Resolves: #468 +- Updated the UIVertical Scroller to be more efficient for Unity 6 and updated its example +- Updated the Picker control and samples to the latest version +- Removed cap points from the line renderers as they caused LOD and jagged-texture issues +- Renamed Segment to SegmentedControlSegment to avoid class name conflicts +- Updated components to maintain both Text and TextMeshPro compatibility where possible, including a debug option to allow both (#477) +- Reverted Curly Text back to the old Text component as it is not compatible with TextMeshPro - alternatives are being investigated -## Added +### Deprecated -- Add CalculatePointOnCurve for uilinerenderer (@victornor) +- With the move to Unity 6, the old legacy Text based controls have been cleared out as they are no longer valid, along with a general script clean-up to remove legacy dependencies. For any affected component, use the TextMeshPro alternatives. -## Changed +## Additional Notes -- fix: Fixed an null reference exception with the ResetSelectableHighlight (@FejZa) -- fix: Resolved an issue where the last line in a flow layout group would overflow the rect bounds. -- fix: GetPosition when Segments is null (@victornor) -- fix: Fix Bug! NicerOutline color.a Loss when m_UseGraphicAlpha is true (wanliyun) -- fix: Update to force Enumerated start for Accordion elements, Resolves: #455 -- Added argument to the UpdateLayout method for the HSS/VSS to move to a new starting page. -- Updated implementations to handle 2023 support, with 2023 moving in to public release. -- Added extra event on the AutoCompleteComboBox, to fire when an item in the list is selected, with its display name. -- FlowLayoutGroup components updated to latest (likely the last as the author has stopped development) +### [Installation Instructions](https://unity-ui-extensions.github.io/UPMInstallation.html) -## Deprecated +The recommended way to add the Unity UI Extensions project to your solution is to use the Unity package Manager. Simply use the Unity Package Manager to reference the project to install it -- All deprecated Text based components now have "obsolete" tags, to avoid breaking code. Note, these do not function in 2022 and above, as Unity have "changed" things. For any affected component, I recommend updating to use TextMeshPro native features. +New for 2020, we have added OpenUPM support and the package can be installed using the following [OpenUPM CLI](https://openupm.com/docs/) command: + +```cli +`openupm add com.unity.uiextensions` +``` + +> For more details on using [OpenUPM CLI, check the docs here](https://github.com/openupm/openupm-cli#installation). - [UI Extensions Issue log](https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues) @@ -91,7 +116,7 @@ For more details, see the [deprecation notice](https://github.com/Unity-UI-Exten We recommend using the UPM delivery method. If you are using the Unity asset, there should be no issues updating but if you have a problem, just deleted the old Unity-UI-Extensions folder and import the asset new. -# Document revision history +## Document revision history |Date|Details| |-|-| @@ -100,3 +125,4 @@ We recommend using the UPM delivery method. If you are using the Unity asset, th |August 8th, 2020|2019.4 (v2.2) released, New UPM Delivery.| |October 10th, 2020|2019.5 (v2.2) released, New UPM fast delivery| |February 7th, 2022|v2.3 released, New Home, UPM fast delivery via OpenUPM| +|June 6th, 2026|v3.0 released, Unity6, the only path| diff --git a/Editor/CanvasGroupActivator.cs b/Editor/CanvasGroupActivator.cs index 99cb48e0..06641dd8 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 52c8b6cd..ae1e3467 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/Examples~ b/Examples~ index 4b7b0c01..bfcb7766 160000 --- a/Examples~ +++ b/Examples~ @@ -1 +1 @@ -Subproject commit 4b7b0c010808170542403a649faf40d4ed1d20de +Subproject commit bfcb7766eada96934a13ba48f89ce99bc64d7327 diff --git a/README.md b/README.md index 83221812..2c4b84b3 100644 --- a/README.md +++ b/README.md @@ -74,15 +74,11 @@ To get started with the project, here's a little guide: ## [Updates:](https://unity-ui-extensions.github.io/ReleaseNotes/RELEASENOTES) -## Release 2.4.0 - Unity supports Unity UI - 2025/11/20 +## Release 3.0.0 - Unity 6, reimagined - 2026/06/19 -Stay tuned as we begin work on a Unity 6 update, to verify Unity 6 support and possibly get some new controls in the mix. +The V3 relaunch brings **full Unity 6 support**, a refreshed brand, and the start of a two-package ecosystem — the proven uGUI library you know, now joined by a modern UI Toolkit companion. -## Release 2.3.2 - Rejuvenation - 2023/11/26 - -2023 is certainly an interesting year to keep you on your toes, and finding time to keep managing all the requests and updates that come in are taking their toll, especially for a FREE project, but nonetheless, I still do it. - -Mainly bugfixes for the end of year update, promoting some resolutions that have been verified and tested since the last release. +> **Two packages. One ecosystem.** These notes cover the **uGUI** package (`com.unity.uiextensions`). Meet its new companion: [UI Toolkit Extensions](https://github.com/Unity-UI-Extensions/com.unity.uitoolkitextensions). To get up to speed with the Unity UI Extensions, check out the [Getting Started](https://unity-ui-extensions.github.io/GettingStarted.html) Page. @@ -93,33 +89,58 @@ To get up to speed with the Unity UI Extensions, check out the [Getting Started] > > Much easier that posting a question / issue on YouTube, Twitter or Facebook :D -## Breaking changes - -For customers upgrading from earlier versions of Unity to Unity 2020, please be aware of the Breaking change related to Text Based components. You will need to manually replace any UI using the older ```Text``` component and replace them with ```TextMeshPro``` versions. This is unavoidable due to Unity deprecating the Text component. - -> New users to 2022 are unaffected as all the Editor commands have been updated to use the newer TextMeshPro versions. - -For more details, see the [deprecation notice](https://github.com/Unity-UI-Extensions/com.unity.uiextensions/discussions/428) on GitHub. - -## Added - -- Add CalculatePointOnCurve for uilinerenderer (@victornor) +### Added + +- Full support for Unity 6, updating all controls and editor components for the new Unity UI framework, including compile flag support for the updated Unity 6 API (#493, #497) +- Added new GridRawImage control, applying a texture as a repeating grid on a RawImage +- Added new UI_Knob2 control, an updated take on the rotary UI Knob +- Added new UISegmentedCircle control, for drawing segmented circular UI +- Added new UI Graphic Selector control +- Added SetXWithoutNotify and SetYWithoutNotify methods to the BoxSlider, to set values without firing OnValueChanged (@Kurante2801) +- The Pivot can now be used as the reference point when drawing lines with the UILineRenderer (#490) +- Added a "close line" option to the UILineRenderer which finishes the line off with a closer to fill any gaps at the end - Resolves: #449 +- Added a new "CullingMode" option to the UI Particle System that when enabled alters the control to resolve unscaled delta time issues - Fixes #486, #487 + +### Changed + +- fix: Optimized Gradient2 when ModifyMesh is called, and it now responds to gradient key updates in both the inspector and at runtime (@bluefallsky) +- fix: Corrected the radial triangle add order (#384) (@bluefallsky) +- fix: The UILineConnector now refreshes when the global scale changes and its point array calculation has been corrected (#495) (@hugoymh) +- fix: The ReorderableList now keeps an item's rotation configuration while dragging (@JavierMonton) +- fix: Addressed a null reference exception in the ReorderableList +- fix: Resolved a stacking issue with the ReorderableList when moving elements "slightly" - Resolves: #470 +- fix: Force ScrollRect.content setup on initialization (#485) +- fix: Resolved a race condition in the ScrollSnap controls which could raise a NaN error when lerping - Resolves: #452 / #508 +- fix: Patched the HSS/VSS against a potential divide by zero error if the scroll snap has a single page +- fix: Updated GetCurrentPage on the ScrollSnaps to be more resilient - Fixes #254 +- fix: Updated the ScrollSnaps to be more resilient to rescaling and patched the full screen scroll snap RIF - Fixes #257, #260 +- fix: Resolved out of bounds issues with the Infinite scroll control - Fixes #237 +- fix: Addressed layout issues with the FlowLayoutGroup - Fixes #456 +- Layout groups updated to rebuild on disable/enable - Resolves: #468 +- Updated the UIVertical Scroller to be more efficient for Unity 6 and updated its example +- Updated the Picker control and samples to the latest version +- Removed cap points from the line renderers as they caused LOD and jagged-texture issues +- Renamed Segment to SegmentedControlSegment to avoid class name conflicts +- Updated components to maintain both Text and TextMeshPro compatibility where possible, including a debug option to allow both (#477) +- Reverted Curly Text back to the old Text component as it is not compatible with TextMeshPro - alternatives are being investigated + +### Deprecated + +- With the move to Unity 6, the old legacy Text based controls have been cleared out as they are no longer valid, along with a general script clean-up to remove legacy dependencies. For any affected component, use the TextMeshPro alternatives. + +## Additional Notes + +### [Installation Instructions](https://unity-ui-extensions.github.io/UPMInstallation.html) -## Changed +The recommended way to add the Unity UI Extensions project to your solution is to use the Unity package Manager. Simply use the Unity Package Manager to reference the project to install it -- fix: Fixed an null reference exception with the ResetSelectableHighlight (@FejZa) -- fix: Resolved an issue where the last line in a flow layout group would overflow the rect bounds. -- fix: GetPosition when Segments is null (@victornor) -- fix: Fix Bug! NicerOutline color.a Loss when m_UseGraphicAlpha is true (wanliyun) -- fix: Update to force Enumerated start for Accordion elements, Resolves: #455 -- Added argument to the UpdateLayout method for the HSS/VSS to move to a new starting page. -- Updated implementations to handle 2023 support, with 2023 moving in to public release. -- Added extra event on the AutoCompleteComboBox, to fire when an item in the list is selected, with its display name. -- FlowLayoutGroup components updated to latest (likely the last as the author has stopped development) +New for 2020, we have added OpenUPM support and the package can be installed using the following [OpenUPM CLI](https://openupm.com/docs/) command: -## Deprecated +```cli +`openupm add com.unity.uiextensions` +``` -- All deprecated Text based components now have "obsolete" tags, to avoid breaking code. Note, these do not function in 2022 and above, as Unity have "changed" things. For any affected component, I recommend updating to use TextMeshPro native features. +> For more details on using [OpenUPM CLI, check the docs here](https://github.com/openupm/openupm-cli#installation). - [UI Extensions Issue log](https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues) @@ -151,44 +172,43 @@ There are almost 70+ extension controls / effect and other utilities in the proj [Controls](https://unity-ui-extensions.github.io/Controls.html#controls) -|Accordion|ColorPicker|Selection Box|UI Flippable|ComboBox| +|Accordion|ColorPicker|Selection Box|Segmented Control|ComboBox| |-|-|-|-|-| |AutoComplete ComboBox|DropDown List|BoundToolTip|UIWindowBase|UI Knob| -|TextPic|Input Focus|Box Slider|Cooldown Button|Segmented Control| -|Stepper|Range Slider|Radial Slider|MultiTouch Scroll Rect|MinMax SLider| +|UI Knob2|TextPic|Input Focus|Box Slider|Cooldown Button| +|Stepper|Range Slider|Radial Slider|MultiTouch Scroll Rect|MinMax Slider| +|GridRawImage|UICircleSegmented|UIGraphicSector||| [Primitives](https://unity-ui-extensions.github.io/Controls.html#primitives) -|UILineRenderer|UILineTextureRenderer|UICircle|DiamondGraph|UICornerCut| +|UILineRenderer|UILineTextureRenderer|UILineRendererFIFO|UILineRendererList|UICircle| |-|-|-|-|-| -|UIPolygon|UISquircle|||| +|DiamondGraph|UICornerCut|UIPolygon|UISquircle|UIGridRenderer| [Layouts](https://unity-ui-extensions.github.io/Controls.html#layouts) |Horizontal Scroll Snap|Vertical Scroll Snap|Flow Layout Group|Radial Layout|Tile Size Fitter| |-|-|-|-|-| -|Scroll Snap (alt implementation)|Reorderable List|UI Vertical Scroller|Curved Layout|Table Layout| -|FancyScrollView|Card UI|Scroll Position Controller (obsolete)|Content Scroll Snap Horizontal|Scroller| -|ResizePanel|RescalePanel|RescaleDragPanel||| +|Scroll Snap (alt implementation)|Reorderable List|UI Vertical Scroller|UI Horizontal Scroller|Curved Layout| +|Table Layout|FancyScrollView|Card UI|Scroll Position Controller (obsolete)|Content Scroll Snap Horizontal| +|Scroller|ResizePanel|RescalePanel|RescaleDragPanel|| [Effects](https://unity-ui-extensions.github.io/Controls.html#effect-components) -|Best Fit Outline|Curved Text|Gradient|Gradient2|Letter Spacing| +|Gradient|Gradient2|RaycastMask|SoftAlphaMask|UIFlippable| |-|-|-|-|-| -|NicerOutline|RaycastMask|UIFlippable|UIImageCrop|SoftAlphaMask| -|CylinderText|UIParticleSystem|CurlyUI|Shine Effect|Shader Effects| +|UIImageCrop|UIParticleSystem|CurlyUI|Shine Effect|Shader Effects| -> Text Effects are not supported with TextMeshPro due to its architecture, try using the native TextMeshPro effects instead. +> The legacy Text based effects (Best Fit Outline, Curved Text, Letter Spacing, NicerOutline and CylinderText) were removed in V3.0.0 as they are not supported with TextMeshPro due to its architecture, try using the native TextMeshPro effects instead. [Additional Components](https://unity-ui-extensions.github.io/Controls.html#additional-components) |ReturnKeyTrigger|TabNavigation|uGUITools|ScrollRectTweener|ScrollRectLinker| |-|-|-|-|-| |ScrollRectEx|UI_InfiniteScroll|UI_ScrollRectOcclusion|UIScrollToSelection|UISelectableExtension| -|switchToRectTransform|ScrollConflictManager|CLFZ2 (Encryption)|DragCorrector|PPIViewer| -|UI_TweenScale|UI_MagneticInfiniteScroll|UI_ScrollRectOcclusion|NonDrawingGraphic| -|UILineConnector| -|UIHighlightable|Menu Manager|Pagination Manager||| +|switchToRectTransform|ScrollConflictManager|CLFZ2 (Compression)|DragCorrector|PPIViewer| +|UI_TweenScale|UI_MagneticInfiniteScroll|NonDrawingGraphic|UILineConnector|UIHighlightable| +|Menu Manager|Pagination Manager|ResetSelectableHighlight|SelectableScaler|InputFieldEnterSubmit| *More to come* diff --git a/Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs b/Runtime/Scripts/Controls/ColorPicker/ColorPickerPresets.cs index c0bcdbda..62ba10df 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 d7d573ac..48f96e6e 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 8277e9ea..5f29eccd 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 b890a84e..427cecc4 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/Controls/UIGraphicSector/Sector.cs b/Runtime/Scripts/Controls/UIGraphicSector/Sector.cs index da1010f0..746c587b 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 3a555bf3..e574d38a 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 a949d0c2..05e679e9 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 663857f6..9e53a74c 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 0c8ef110..ec81bb79 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); diff --git a/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs b/Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs index a9fbf960..c7c57619 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 3c8e0e59..5a0ed412 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 8afe3f0d..b5391871 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; diff --git a/package.json b/package.json index ec166e1c..268b1cbc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.uiextensions", "displayName": "Unity UI Extensions", - "version": "3.0.0-pre.1", + "version": "3.0.1-pre.1", "description": "An extension project for the Unity3D UI system, all crafted and contributed by the awesome Unity community", "author": "Simon darkside Jackson <@SimonDarksideJ>", "contributors": [