Exemplo n.º 1
0
        private void OnGUI()
        {
            if (instance == null)
            {
                instance = this;
            }

            if (toolBagDataList == null)
            {
                LoadData();
            }

            if (toolBagDataList.Count == 0)
            {
                return;
            }

            scrollValue = GUILayout.BeginScrollView(scrollValue);
            GUILayout.BeginVertical();

            GUILayout.Space(2);

            bool isShowList = toolBagDataList[0].IsShow;

            if (!isShowList)
            {
                if (GUILayout.Button("详情"))
                {
                    ToolBagDetailWindow.ShowWindow();
                }

                GUILayout.Space(2);

                if (GUILayout.Button("编辑面板"))
                {
                    ToolBagManager.SaveToolDataStatus(new ToolSaveData("编辑面板", true));
                }
            }

            GUILayout.Space(10);

            for (int i = 0; i < toolBagDataList.Count; i++)
            {
                if (!toolBagDataList[i].IsShow || (isShowList && i != 0))
                {
                    continue;
                }

                GUILayout.TextArea(toolBagDataList[i].Name, new GUIStyle("DefaultCenteredText")
                {
                    fontStyle = FontStyle.Bold
                });

                toolBagDataList[i].ShowGUI();
                GUILayout.Space(2);
            }

            GUILayout.EndVertical();
            GUILayout.EndScrollView();
        }
Exemplo n.º 2
0
 public static void ShowToolWindow()
 {
     ToolBagShowWindow.ShowWindow();
 }
Exemplo n.º 3
0
 private void OnDestroy()
 {
     instance = null;
 }