Unity 6.2 以降 6.5 未満で TreeView が Obsolete 警告を出すのに対応

Unity 6.2 の時点で、非Genericな `TreeView` が Obsolete となり警告が出るようになりました。これを抑制します。

Unity 6.5 でそのクラスは削除されたため、 https://github.com/vrm-c/UniVRM/issues/2803 で `#if UNITY_6000_5_OR_NEWER` を用いて Unity 6.5 以降はGeneric版の `TreeView<int>`  に置き換わるようになっています。

この `#if` 条件を `UNITY_6000_2_OR_NEWER` に拡張することで、 6.5 未満かつ 6.2 の場合でも新版を利用するようにし、警告が出力されないようにしました。

発生していた警告は次のようなものでした。

```
Packages\VRM10\Editor\Components\SpringBone\SpringBoneTreeView.cs(14,39): warning CS0618: 'TreeView' is obsolete: 'TreeView is now deprecated. You can likely now use TreeView<int> instead and not think more about it. But if you were using that identifier to store InstanceID data, you should instead opt to upgrade your TreeViews to use TreeView<InstanceID> to get the proper typing.'
```
This commit is contained in:
Isamu Mogi
2026-07-04 15:32:14 +09:00
parent 42f5cc15d9
commit 2445f98017
2 changed files with 2 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine;
#if UNITY_6000_5_OR_NEWER
#if UNITY_6000_2_OR_NEWER
using TreeView = UnityEditor.IMGUI.Controls.TreeView<int>;
using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem<int>;
using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState<int>;

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
#if UNITY_6000_5_OR_NEWER
#if UNITY_6000_2_OR_NEWER
using TreeView = UnityEditor.IMGUI.Controls.TreeView<int>;
using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem<int>;
using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState<int>;