- Home /
Render camera in EditorWindow
I'm making an Editor extension that needs its own rendering window, usable in both unity free and pro.
I have tried both Handles.DrawCamera and Camera.Render But both produce the result like in the picture below(the depth is wrong). However Camera.Render works as expected in the Game view window.
Anyone that has been doing something similiar?
The GUI code looks like this
void OnGUI()
{
GUILayout.Label("hello world");
if (cam != null)
{
float height = this.position.height;
cam.pixelRect = new Rect(10, 0, this.position.width - 25, height - 50);
Handles.DrawCamera(cam.pixelRect, cam, DrawCameraMode.Normal);
}
}
wtf.png
(28.4 kB)
Comment
Answer by $$anonymous$$ · Oct 23, 2018 at 03:49 PM
Maybe using DrawCameraMode.Textured helps, as suggested here: http://answers.unity.com/answers/372552/view.html