How to build an editor window with a treeview widget?


I would like to build an editor window with a treeview very much like the project view or Hierarchy view. Only that the content is arbitrary, it's not the gameObject in the scene nor the project content.

Is it possible? Can't find anything in the help on this.

Thanks for your help,


Well, there's is not ready-to-use tree view. Even if there is one it would be a pain to provide the containing data (due to immediate mode). But it's not impossible. You can create your own treeview. Just "some" labels/buttons/.... and you're done :D

Sorry for the necro. But after trying to find a solution for my own needs I stumbled across this.

I believe you could achieve something similar to what you what, by manipulating the “EditorGUI.Foldout” function. You could create a function that makes nested foldouts as a workaround.

(Just for anyone else who stumbles across this like I did. Although it’s not a copy&paste solution, it shouldn’t be hard to implement.)


I’m resurrecting this because I was recently looking for a solution too. Nevertheless, I really didn’t find anything that matched my needs, so I made it myself and decided to sell it on the asset store.

You can find it under the name TreeView GUI.

I Hope this will meet your expectations.

The tree view control is available in the Asset Store link text.