Created
June 10, 2012 03:04
-
-
Save anchan828/2903701 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class RenderGameViewCamerasScript : EditorWindow | |
{ | |
[MenuItem("EditorGUIUtility/RenderGameViewCameras")] | |
static void OpenWindow () | |
{ | |
RenderGameViewCamerasScript window = GetWindow<RenderGameViewCamerasScript> (); | |
window.position = new Rect (50, 50, 500, 500); | |
} | |
private Rect rect1, rect2; | |
void OnGUI () | |
{ | |
rect1 = new Rect (0, 0, 300, 200); | |
//rect2は決め打ち。こうしないと描画がおかしくなる | |
rect2 = new Rect (0, 22, position.width, position.height); | |
EditorGUIUtility.RenderGameViewCameras (rect1, rect2, true, true); | |
this.Repaint (); | |
//強制的にGUI終了させないとNULLで怒られる。非推奨関数 | |
EditorGUIUtility.ExitGUI (); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment