public static void OpenWindowTest(WindowTestEditorWindow _window) { CloseTest(); window = _window; _window.titleContent = new GUIContent("UI Test"); _window.position = new Rect(Screen.width * 0.5f - 400, Screen.height * 0.5f - 300, 1200, 600); _window.testTool.BindController(); _window.Show(); }
public override void OnInspectorGUI() { UITest tool = (UITest)target; GUILayout.Space(20); GUILayout.BeginHorizontal(); GUILayout.Space(50); if (GUILayout.Button("打开测试窗口", GUILayout.ExpandWidth(true))) { WindowTestEditorWindow editorWin = new WindowTestEditorWindow(); editorWin.testTool = tool; WindowTestEditorWindow.OpenWindowTest(editorWin); } GUILayout.Space(50); GUILayout.EndHorizontal(); GUILayout.Space(20); Repaint(); }