コード例 #1
0
ファイル: TestWinC.cs プロジェクト: zhejimanyu/USubWindow
    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"))
        {
        }
    }
コード例 #2
0
 /// <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]);
         }
     }
 }
コード例 #3
0
 /// <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);
         }
     }
 }