blob: 437303a05eb62af74a43b11a7bbad67da30c10cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MainCamera))]
public class MainCameraEditor : Editor
{
private void OnEnable()
{
MainCameraDebug.OnGUIHandlers -= OnGameViewGUI;
MainCameraDebug.OnGUIHandlers += OnGameViewGUI;
}
private void OnDisable()
{
MainCameraDebug.OnGUIHandlers -= OnGameViewGUI;
InspectorUtility.RepaintGameView();
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
}
private void OnGameViewGUI()
{
MainCamera camera = target as MainCamera;
if (camera == null)
return;
//Matrix4x4 oldMatrix = GUI.matrix;
//Rect cameraRect = new Rect(0, 0, 500, 500);
//GUI.matrix = Matrix4x4.Translate(cameraRect.min);
////GUILayout.Button("test");
//GUI.DrawTexture(new Rect(0, 0, 30, 30), Texture2D.whiteTexture);
//GUI.matrix = oldMatrix;
}
}
|