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(); }
private void OnGUI() { if (instance == null) { instance = this; } if (toolBagDataList == null) { LoadData(); } GUILayout.BeginVertical(); GUILayout.Space(2); if (selectData == null) { toolBagDataList.ForEach(x => { if (GUILayout.Button(x.Name)) { selectData = x; } GUILayout.Space(2); }); } else { if (GUILayout.Button("返回")) { selectData = null; } GUILayout.Space(5); if (selectData != null) { GUILayout.TextArea(selectData.Name, new GUIStyle("DefaultCenteredText") { fontStyle = FontStyle.Bold }); GUILayout.Space(2); selectData?.ShowWindow(); } } GUILayout.EndVertical(); }