Exemplo n.º 1
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();
    }