public void OnGUI()
    {
        if (GUIWindow.DrawHeader("管理"))
        {
            GUILayout.BeginHorizontal();
            {
                if (GUILayout.Button("保存配置", GUILayout.Width(90)))
                {
                    SaveCf();
                }
                if (GUILayout.Button("重置配置", GUILayout.Width(90)))
                {
                    ResetCf();
                }
            }
            GUILayout.EndHorizontal();
        }

        foreach (var pathList in PathDic)
        {
            if (GUIWindow.DrawHeader(pathList.Key))
            {
                OnGUIPathList(pathList.Value);
            }
        }
    }
Ejemplo n.º 2
0
    void ShowPageIndexHeader()
    {
        int BtnPageColums = Mathf.FloorToInt(ScreenWidth / (GUIWindow.BtnShortSelectedStyle.fixedWidth + 3 * 2));

        try
        {
            if (PageCount > 1 && GUIWindow.DrawHeader("目录"))
            {
                for (int i = 0; i < PageCount; i++)
                {
                    int column = i % BtnPageColums;
                    if (column == 0)
                    {
                        GUILayout.BeginHorizontal();
                    }

                    if (CurPage == i + 1)
                    {
                        if (GUILayout.Button((i + 1).ToString(), GUIWindow.BtnShortSelectedStyle))
                        {
                            CurPage = i + 1;
                        }
                    }
                    else
                    {
                        if (GUILayout.Button((i + 1).ToString(), GUIWindow.BtnShortNormalStyle))
                        {
                            CurPage = i + 1;
                        }
                    }


                    if (column == BtnPageColums - 1 || i == PageCount - 1)
                    {
                        GUILayout.EndHorizontal();
                        GUILayout.Space(itemMarginH);
                    }
                }
            }
            GUIWindow.DrawSeparator();
        }
        catch { }
    }