Skip to content

fix: use System.Enum APIs in ToonEnumUtility to ensure ordering#836

Merged
sindharta merged 9 commits into
masterfrom
fix-enum-utility
Jun 15, 2026
Merged

fix: use System.Enum APIs in ToonEnumUtility to ensure ordering#836
sindharta merged 9 commits into
masterfrom
fix-enum-utility

Conversation

@sindharta

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 ToonEnumUtility to build inspector labels and option values using System.Enum APIs rather than enumerating members via reflection, aiming to better align popup values with actual enum constants.

Changes:

  • ToInspectorNamesAsGUIContent: switched to Enum.GetNames and looks up InspectorNameAttribute per enum field.
  • ToIndices: switched to Enum.GetValues to return the actual enum numeric values instead of sequential indices.
  • Removed an unused using directive.

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

Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated
Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated
Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated
sindharta-tanuwijaya and others added 2 commits June 12, 2026 15:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sindharta-tanuwijaya sindharta-tanuwijaya changed the title fix fix: using System.Enum APIs in ToonEnumUtility to ensure ordering Jun 12, 2026
@sindharta-tanuwijaya sindharta-tanuwijaya changed the title fix: using System.Enum APIs in ToonEnumUtility to ensure ordering fix: use System.Enum APIs in ToonEnumUtility to ensure ordering Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated
Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs
Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated
Comment thread com.unity.toonshader/Tests/Runtime/Scripts/ToonEnumUtilityTests.cs
Comment thread com.unity.toonshader/Editor/Scripts/GUI/UnityToon3Das2DGUI.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread com.unity.toonshader/Runtime/Scripts/Utilities/ToonEnumUtility.cs Outdated
Comment thread com.unity.toonshader/Tests/Runtime/Scripts/ToonEnumUtilityTests.cs
Comment thread com.unity.toonshader/Editor/Scripts/GUI/UnityToon3Das2DGUI.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@sindharta sindharta merged commit 6f727b0 into master Jun 15, 2026
32 checks passed
@sindharta sindharta deleted the fix-enum-utility branch June 15, 2026 07:17
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.

3 participants