using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
public class BugReportWindow : EditorWindow {
int normalTextSize;
string windowTitle;
Object source;
int num = 0;
[MenuItem("내가만든메뉴/내가만든윈도우")]
static void Init()
{
BugReportWindow window = (BugReportWindow)EditorWindow.GetWindow(typeof(BugReportWindow));
window.titleContent.text = "내가만든윈도우";
window.Show();
}
private void OnGUI()
{
GUILayout.BeginVertical();
GUILayout.Space(10);
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
normalTextSize = GUI.skin.label.fontSize;
GUI.skin.label.fontSize = 25;
GUILayout.Label("연습중");
GUI.skin.label.fontSize = normalTextSize;
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.EndVertical();
GUILayout.Space(10);
windowTitle = EditorGUILayout.TextField("제목을 적어주세요", windowTitle, GUILayout.Width(300));
GUILayout.Label("씬 : " + EditorSceneManager.GetActiveScene().path);
GUILayout.Label("시간 : " + System.DateTime.Now.ToString());
source = EditorGUILayout.ObjectField("오브젝트", source, typeof(Object), true);
GUILayout.BeginHorizontal();
GUILayout.Label(num.ToString());
if (GUILayout.Button("+"))
num++;
if (GUILayout.Button("-"))
num--;
GUILayout.EndHorizontal();
}
}
![](https://t1.daumcdn.net/cfile/tistory/23627D4A59087AFD25)