Skip to content

Conversation

@SimonDarksideJ
Copy link
Contributor

Unity UI Extensions - Pull Request

Overview

The beginnings of an overhaul to validate support for Unity 6, possibly even some new controls.

Changes

  • Well, Unity 6 support for a start, but let's see how we go!
  • Fixes:

Breaking Changes

  • Breaks ??

Related Submodule Changes

  • URL

Testing status

  • No tests have been added.
  • Includes unit tests.
  • Includes performance tests.
  • Includes integration tests.

Manual testing status

@SimonDarksideJ SimonDarksideJ marked this pull request as ready for review December 7, 2025 10:13
Copilot AI review requested due to automatic review settings December 7, 2025 10:13
@SimonDarksideJ SimonDarksideJ merged commit fa5ad49 into development Dec 7, 2025
9 of 12 checks passed
@SimonDarksideJ SimonDarksideJ deleted the feature/Unity6 branch December 7, 2025 10:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Unity UI Extensions package to support Unity 6, marking a major version bump from 2.3.3-pre.1 to 3.0.0-pre.1. The changes primarily involve removing version-specific conditional compilation directives and obsolete components that are no longer needed with Unity 6's requirement for TextMeshPro.

Key changes:

  • Updated minimum Unity version from 2020.3 to 6000.0 (Unity 6)
  • Added dependency on com.unity.ugui 2.0.0
  • Removed legacy Unity Text components in favor of TextMeshPro (TMP_Text)
  • Cleaned up obsolete version checks and conditional compilation directives
  • Removed deprecated text effects (NicerOutline, BestFitOutline, LetterSpacing, MonoSpacing, CylinderText, CurvedText)

Reviewed changes

Copilot reviewed 45 out of 46 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
package.json Updated version to 3.0.0-pre.1, minimum Unity to 6000.0, added ugui 2.0.0 dependency
Runtime/Scripts/Utilities/UI_ScrollRectOcclusion.cs Fixed spacing in comment text
Runtime/Scripts/Utilities/UIExtensionsInputManager.cs Simplified input system version check
Runtime/Scripts/Utilities/PPIViewer.cs Removed legacy Text support, TMP_Text only
Runtime/Scripts/Utilities/ExtensionsToggle.cs Removed obsolete Unity 2018.3 version check
Runtime/Scripts/ToolTips/ToolTip.cs Removed version checks, standardized to TMP_Text, improved code formatting
Runtime/Scripts/ToolTips/HoverTooltip.cs Removed legacy Text support
Runtime/Scripts/ToolTips/BoundTooltip/BoundTooltipItem.cs Changed to TMP_Text, removed version checks
Runtime/Scripts/Layout/UIVerticalScroller.cs Added property accessors, moved initialization logic, removed version checks
Runtime/Scripts/Layout/UIHorizontalScroller.cs Formatting fixes, removed version checks for Text components
Runtime/Scripts/Layout/FlowLayoutGroup.cs Removed unused import, fixed indentation
Runtime/Scripts/Effects/UIParticleSystem.cs Removed Unity 2019.1 version check, formatting fixes
Runtime/Scripts/Effects/SoftMaskScript.cs Removed legacy Text support
Runtime/Scripts/Effects/NicerOutline.cs Deleted obsolete effect (not supported in Unity 2022+)
Runtime/Scripts/Effects/MonoSpacing.cs Deleted obsolete effect
Runtime/Scripts/Effects/LetterSpacing.cs Deleted obsolete effect
Runtime/Scripts/Effects/Gradient2.cs Removed version checks for Unity 2021+ features, formatting fixes
Runtime/Scripts/Effects/CylinderText.cs Deleted obsolete effect
Runtime/Scripts/Effects/CurvedText.cs Deleted obsolete effect
Runtime/Scripts/Effects/CurlyUI/CUIText.cs Reverted to legacy Text (inconsistent with other changes)
Runtime/Scripts/Effects/BestFitOutline.cs Deleted obsolete effect
Runtime/Scripts/Controls/TextPic.cs Standardized to TMP_Text, improved code formatting throughout
Runtime/Scripts/Controls/Sliders/BoxSlider.cs Removed Unity 2018.3 version check, formatting fix
Runtime/Scripts/Controls/SelectionBox/SelectionBox.cs Improved code formatting, removed FindObjectsOfType version check
Runtime/Scripts/Controls/SelectionBox/ExampleSelectable.cs Removed legacy Text support
Runtime/Scripts/Controls/Segment.cs Removed legacy Text support
Runtime/Scripts/Controls/ReorderableList/ReorderableListDebug.cs Removed version checks for TMP_Text and FindObjectsByType
Runtime/Scripts/Controls/ComboBox/DropDownListButton.cs Removed legacy Text support
Runtime/Scripts/Controls/ComboBox/ComboBox.cs Changed to TMP_InputField, simplified component lookup
Runtime/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs Changed to TMP_InputField, simplified component lookup
Runtime/Scripts/Controls/ColorPicker/HexColorField.cs Changed to TMP_InputField, updated event listener, simplified variable declaration
Runtime/Scripts/Controls/ColorPicker/ColorSampler.cs Fixed variable naming from oncolorSelected to onColorSelected
Runtime/Scripts/Controls/ColorPicker/ColorLabel.cs Fixed parameter typo (sateration → saturation), removed legacy Text support
Runtime/Scripts/Controls/ColorPicker/ColorImage.cs Fixed indentation
README.md Added release note for version 2.4.0
Examples~ Updated submodule commit reference
Editor/UIExtensionsMenuOptions.cs Simplified input system check, removed FindObjectOfType version checks, fixed indentation
Editor/CanvasGroupActivator.cs Removed FindObjectsOfType version check
Editor/CUIImageEditor.cs Removed Unity 2022.1 version check for Handles.FreeMoveHandle
.github/workflows/development-buildandtestupmrelease.yml Updated CI to only test Unity 6, adjusted build targets
Comments suppressed due to low confidence (2)

Runtime/Scripts/ToolTips/ToolTip.cs:1

  • The error message is incomplete. It should specify 'Text' or 'TMP_Text component' instead of just ' component'.
    Runtime/Scripts/Layout/UIVerticalScroller.cs:1
  • These new public properties expose internal fields without any validation or documentation. Consider adding XML documentation comments to explain their purpose and any constraints on their usage, especially since they allow external code to modify internal state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


// Add listeners to keep text (and color) up to date
hexInputField.onEndEdit.AddListener(UpdateColor);
hexInputField.onValueChanged.AddListener(UpdateColor);
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from 'onEndEdit' to 'onValueChanged' which will cause UpdateColor to be called on every character typed, not just when editing is complete. This could impact performance and may cause unexpected behavior if color parsing fails on incomplete hex values.

Copilot uses AI. Check for mistakes.
#if UNITY_2022_1_OR_NEWER
[RequireComponent(typeof(TMPro.TMP_Text))]
#else
[RequireComponent(typeof(Text))]
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file still references the legacy 'Text' component instead of 'TMPro.TMP_Text', which is inconsistent with the rest of the PR where all Text components have been replaced with TextMeshPro. This should be updated to use TMP_Text for consistency with Unity 6 requirements.

Copilot uses AI. Check for mistakes.
_rectTransform = GetComponent<RectTransform>();
_inputRT = _rectTransform.Find("InputField").GetComponent<RectTransform>();
_mainInput = _inputRT.GetComponent<InputField>();
_mainInput = GetComponentInChildren<TMPro.TMP_InputField>();
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If GetComponentInChildren returns null, the next line will throw a NullReferenceException. The original code had _inputRT set first, which would have caught this earlier. Consider adding a null check or reordering to validate _mainInput before using it.

Suggested change
_mainInput = GetComponentInChildren<TMPro.TMP_InputField>();
_mainInput = GetComponentInChildren<TMPro.TMP_InputField>();
if (_mainInput == null)
{
Debug.LogError("ComboBox: No TMP_InputField found in children. Please ensure a TMP_InputField is present.");
success = false;
return success;
}

Copilot uses AI. Check for mistakes.
_rectTransform = GetComponent<RectTransform>();
_inputRT = _rectTransform.Find("InputField").GetComponent<RectTransform>();
_mainInput = _inputRT.GetComponent<InputField>();
_mainInput = GetComponentInChildren<TMPro.TMP_InputField>();
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If GetComponentInChildren returns null, the next line will throw a NullReferenceException. The original code had _inputRT set first, which would have caught this earlier. Consider adding a null check or reordering to validate _mainInput before using it.

Suggested change
_mainInput = GetComponentInChildren<TMPro.TMP_InputField>();
_mainInput = GetComponentInChildren<TMPro.TMP_InputField>();
if (_mainInput == null)
{
Debug.LogError("AutoCompleteComboBox: No TMP_InputField found in children. Initialization failed.");
return false;
}

Copilot uses AI. Check for mistakes.
protected void UpdateQuadImage()
{
#if UNITY_EDITOR
if (UnityEditor.PrefabUtility.GetPrefabAssetType(this) == UnityEditor.PrefabAssetType.Regular)
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from checking PrefabType.Prefab to PrefabAssetType.Regular, which is the correct API for Unity 2018.3+. However, the condition logic might need review - the original code checked '!= Prefab' while this checks '== Regular', which may not be equivalent for all prefab types.

Suggested change
if (UnityEditor.PrefabUtility.GetPrefabAssetType(this) == UnityEditor.PrefabAssetType.Regular)
if (UnityEditor.PrefabUtility.GetPrefabAssetType(this) != UnityEditor.PrefabAssetType.NotAPrefab)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants