- Home /
Extending the Project View
I need to be able to perform a function on any asset in the Project View (FBX file, material, prefab, etc...) for version-control purposes.
I would be perfectly happy doing this in any number of ways:
Adding a context menu option, Adding a drop-down menu to the top of the Project view (like the Create drop-down), Adding a button (somehow) to the Project pane, etc.
Is there any way to do this? I would prefer not having to add a top-level menu item (File, Edit, etc) for ease of use, but if there's nothing better...
Answer by MibZ · Jan 03, 2013 at 04:46 PM
That could be done with an Editor Script! Everything you see when you use Unity other than the top windows/mac window bar is created using Editor Scripts written by the Unity dev team, and any window they have made inside of Unity can be recreated by anyone who wants to write their own Editor extensions.
Yes, and I feel comfortable in using Editor scripts to create custom editors and custom inspectors, but NOT in extending already-existing default Unity editors, like the Project view. I haven't been able to find documentation for hooking into those default views, but maybe I've just missed it.
I found that there is a bool you can set to draw the default Inspector view, I imagine there is functionality for other important views as well.
Answer by jhand · Jan 17, 2017 at 06:17 PM
You already accepted the other answer here but from the way I read it, you were hoping to find a way to extend the actual Project View. I'll give my answer, in case others thought the same.
According to UnityDecompiled, the Project Browser (along with other editor windows) are internal to Unity and can't be edited. Therefore you may have to reverse engineer the existing project view. I ran into this same problem with the Sprite Editor Window I wanted to extend, but found the class was internal.
https://github.com/MattRix/UnityDecompiled/blob/master/UnityEditor/UnityEditor/ProjectBrowser.cs