Ejemplo n.º 1
0
    private void DrawCurrentCustomGUI(int theWindowID)
    {
        if (itsCurrentSelectedGUI.GetIcon() == null)
        {
            KGFGUIUtility.BeginWindowHeader(itsCurrentSelectedGUI.GetHeaderName(), itsDataModuleCustomGUI.itsUnknownIcon);
        }
        else
        {
            KGFGUIUtility.BeginWindowHeader(itsCurrentSelectedGUI.GetHeaderName(), itsCurrentSelectedGUI.GetIcon());
        }
        GUILayout.FlexibleSpace();
        bool aClose = KGFGUIUtility.EndWindowHeader(true);

        //Draw the content
        if (!aClose)
        {
            // hack to keep the window in min size
            GUILayout.Space(0);

            itsCurrentSelectedGUI.Render();

            GUI.DragWindow();
            //GUI.DragWindow(new Rect(0, 0, itsWindowRectangle.width, KGFGUIUtility.GetWindowStyle().padding.top));
        }
        else
        {
            itsCurrentSelectedGUI = null;
        }
    }
Ejemplo n.º 2
0
    private void DrawCurrentCustomGUI(float aCustomGuiWidth)
    {
        if (itsCurrentSelectedGUI == null)
        {
            return;
        }

        float aHeight = KGFGUIUtility.GetSkinHeight() + KGFGUIUtility.GetStyleButton(KGFGUIUtility.eStyleButton.eButton).margin.vertical + KGFGUIUtility.GetStyleBox(KGFGUIUtility.eStyleBox.eBoxDecorated).padding.vertical;

        GUILayout.BeginArea(new Rect(aHeight, aHeight, Screen.width - aCustomGuiWidth - aHeight, Screen.height - aHeight * 2.0f));
        {
            KGFGUIUtility.BeginVerticalBox(KGFGUIUtility.eStyleBox.eBox);
            {
                if (itsCurrentSelectedGUI.GetIcon() == null)
                {
                    KGFGUIUtility.BeginWindowHeader(itsCurrentSelectedGUI.GetHeaderName(), itsDataModuleCustomGUI.itsUnknownIcon);
                }
                else
                {
                    KGFGUIUtility.BeginWindowHeader(itsCurrentSelectedGUI.GetHeaderName(), itsCurrentSelectedGUI.GetIcon());
                }
                GUILayout.FlexibleSpace();
                bool aClose = KGFGUIUtility.EndWindowHeader(true);

                //Draw the content
                if (!aClose)
                {
                    // hack to keep the window in min size
                    GUILayout.Space(0);
                    itsCurrentSelectedGUI.Render();
                }
                else
                {
                    itsCurrentSelectedGUI = null;
                }
            }
            KGFGUIUtility.EndVerticalBox();
        }
        GUILayout.EndArea();
    }