void AddNewTree(int winID) { NewTreeName = GUI.TextField(new Rect(100, 50, 200, 20), NewTreeName); GUI.Label(new Rect(100, 25, 200, 20), NewTreeInfo); if (GUI.Button(new Rect(150, 100, 100, 40), "Add") || (Event.current.isKey && Event.current.keyCode == KeyCode.Return)) { if (NewTreeName == "" || NewTreeName == " ") { NewTreeInfo = "Must Enter a Name"; } else { isNewWindowShow = false; dialogue.CreateTree(NewTreeName); } } if (GUI.Button(new Rect(370, 0, 30, 30), "X")) { isNewWindowShow = false; } GUI.DragWindow(); EditorUtility.SetDirty(dialogue); }