private void SubWinB(Rect main, Rect toolbar) { GUI.Label(new Rect(main.x, main.y, main.width, 20), "这是一个有Toolbar的SubWindow"); if (GUIEx.ToolbarButton(new Rect(toolbar.x, toolbar.y, 100, toolbar.height), "btn")) { } }
/// <summary> /// 绘制工具栏 /// </summary> public void DrawToolBar() { for (int i = 0; i < m_NodeList.Count; i++) { Rect rect = EditorGUILayout.GetControlRect(GUILayout.Width(70), GUILayout.Height(17)); if (GUIEx.ToolbarButton(rect, m_NodeList[i].m_Text)) { ClickDropDown(rect, m_NodeList[i]); } } }
/// <summary> /// 绘制工具栏-视图按钮 /// </summary> public void DrawViewButton(Rect rect) { // Rect rect = EditorGUILayout.GetControlRect(GUILayout.Width(70), GUILayout.Height(17)); if (GUIEx.ToolbarButton(rect, "Tabs")) { if (m_Root != null) { GenericMenu menu = new GenericMenu(); for (int i = 0; i < m_SubWindowList.Count; i++) { menu.AddItem(new GUIContent(m_SubWindowList[i].Title), m_SubWindowList[i].IsOpen, OnSetSubWindowActive, m_SubWindowList[i]); } menu.DropDown(rect); } } }