I’m looking for a workaround for this bug. I’m asking again here since this issue really bothers me and basically prevents me from doing anything more on what I’ve been working on.
What I’m trying to do is rendering a camera to an EditorWindow using Handles.DrawCamera(). The problem is, that the (normalized/pixel) rect of the camera is always cropped by the game view and I cannot render it the size I want (e.g. the full size of the EditorWindow). If the game view is not visible, it is cropped to 640x480, otherwise to the size of the game view.
What I’ve already tried:
- Disabling the camera behavior in the scene
- HandleUtility.PushCamera() / PopCamera()
- Setting Camera.current back to the previous one after DrawCamera (Camera.SetupCurrent - if that is what this undocumented method does).
- Handles.SetCamera(null) after drawing. This causes, aside from a NullReferenceException, another interesting behavior, since now the game view and DrawCamera mutually affect each others size, i.e. the game view still determines its max size, while the rect I pass into DrawCamera crops the game view’s render of the camera to a smaller size if I set it to be smaller.