July 9, 2017
The purpose of this article is to visit an internal (and currently undocumented)
UnityEditor class that is useful for making Scene View custom editors.
Additionally, I'll introduce an open source custom editor called Scene Shot Bookmarks that speeds up authoring and level design by bookmarking numerous Scene View camera angles.
Currently, there are only two built-in ways to update the Scene View:
Scene View gizmo is rad, but limited
Both are really handy tools, but their use is limited. Additionally, both are slow when you want to quickly reconfigure the Scene View camera angle to a previous vantage point. I figured there was a better way and upon a little research I found out that there was.
Unity has an undocumented
SceneView class that provides a great way to dynamically change the Scene View with a custom editor. This is exactly what I wanted, access to the Scene View itself through code.
I created the Scene Shot Bookmarks custom editor to answer one simple question:
Here is an example screenshot of the custom editor for reference:
Scene Shot Bookmarks
Once the Scene Shot Bookmarks editor is open, you can do one of two things:
That's it. It is a really simple, but useful tool. I additionally used the
ScriptableObject class as opposed to EditorPrefs for persisting saved bookmarks. So, in addition to the two core aforementioned functions of Scene Shot Bookmarks, you can:
Here is a sample shot showcasing how simple it is to change the Scene Shot Bookmark UI to fit your game or application:
Scene Shot Bookmarks - Custom Count
You can get Scene Shot Bookmarks on Github.Github - Scene Shot Bookmarks
If you end up forking and building off it, I'd love to see what you come up with. Ping me on Twitter @derekknox if so and/or if you have any questions or comments.