public class MyWindow :EditorWindow
{
[MenuItem("Go/My Editor")]
static void Init()
{
EditorWindow myWindow= EditorWindow.GetWindow(typeof(MyWindow));
}
string str;
void OnGUI ()
{
GUILayout.BeginVertical ();
GUILayout.Label("Yes",GUILayout.Width(100));
str = GUILayout.TextField (str, GUILayout.Width (100));
if (GUILayout.Button("Ok",GUILayout.Width(100)))
{
Debug.Log(str);
}
GUILayout.EndVertical ();
}
}