Skip to content

fix: resolve TreeView deprecation in Unity 6.2+#706

Open
chikacc wants to merge 1 commit intoCysharp:masterfrom
chikacc:master
Open

fix: resolve TreeView deprecation in Unity 6.2+#706
chikacc wants to merge 1 commit intoCysharp:masterfrom
chikacc:master

Conversation

@chikacc
Copy link
Copy Markdown

@chikacc chikacc commented Mar 28, 2026

Description

Unity 6 (6000.2) has deprecated the non-generic TreeView, TreeViewItem, and TreeViewState classes in UnityEditor.IMGUI.Controls.

  • Unity 6000.2+: Triggers obsolete warnings (CS0618).
  • Unity 6000.5+: Triggers obsolete compiler errors (CS0619).

Solution

Introduced type aliasing for these classes to their generic counterparts (TreeView<int>, etc.) using the #if UNITY_6000_2_OR_NEWER preprocessor directive.

  • Removes deprecation warnings in Unity 6000.2 and later.
  • Fixes build errors in Unity 6000.5 and later.

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.

1 participant