How to create an editor screenview like "camera preview" window for cameras?

Basically I want to be able to create my own editor window which displays a camera view, simliar to the preview you have with Camera scripts. Is there anybody who knows a method of doing so? Thanks in advance

My guess would be something along the lines of:

You can create a window in your gui with Gui.Window http://unity3d.com/support/documentation/ScriptReference/GUI.Window.html?from=EditorWindow

Have the window you just made contain a RenderTexture. http://unity3d.com/support/documentation/Components/class-RenderTexture.html

Then you need to project the camera onto the texture using a RenderTexture

(Pro feature only).

Ok so what i am looking for might be this as well...

I want to be able to have a live preview of what ever camera is selected like the tiny Camera Preview window that shows up but full size of one of my editor windows. This seems like a very basic thing to have to me but i can not seem to find it anywhere..

Q

http://unity3d.com/support/documentation/ScriptReference/EditorWindow-autoRepaintOnSceneChange

[Edit] It uses the RenderTexture, so it is for Unity Pro only.

Maybe that help~

@Rasmus Schlnsen I’ve just finished my own preview asset, maybe it will be useful for you: https://forum.unity3d.com/threads/powerful-preview.460157/