protected override void OnGUI() { base.OnGUI(); using (var scope = new EditorGUILayout.VerticalScope("box")) { var select = info.select; select = EditorGUILayout.Popup("Select Type", select, typeNames); if (select != info.select) { info.select = select; info.Read(types); } var loadType = info.loadType; loadType = (EGFileType)EditorGUILayout.EnumPopup("Read Mode", loadType); if (loadType != info.loadType) { info.loadType = loadType; info.Read(types); } if (GUILayout.Button("Sync")) { info.Sync(types); } } scrollPos = EditorGUILayout.BeginScrollView(scrollPos); using (var scope = new EditorGUILayout.VerticalScope("box")) { GUILayout.Space(10f); using (var scope1 = new EditorGUILayout.VerticalScope("box")) { EditorGUILayout.LabelField(info.manager.GetType().ToString(), mySkin.GetStyle("Title")); } if (info.dataFields.Length <= 0) { return; } var width = position.width * 0.85f / (info.dataFields.Length + 1); using (var scope1 = new EditorGUILayout.VerticalScope("box")) { using (var scope2 = new EditorGUILayout.HorizontalScope()) { using (var scope3 = new EditorGUILayout.HorizontalScope("box")) { EditorGUILayout.LabelField("id", mySkin.GetStyle("ItemButton"), GUILayout.Width(100)); } for (int i = 0; i < info.dataFields.Length; i++) { using (var scope3 = new EditorGUILayout.HorizontalScope("box")) { EditorGUILayout.LabelField(info.dataFields[i].Name, mySkin.GetStyle("ItemName"), GUILayout.Width(width)); } } } for (int i = 0; i < info.dataLength; i++) { var data = info.GetData(i); using (var scope2 = new EditorGUILayout.HorizontalScope()) { using (var scope3 = new EditorGUILayout.HorizontalScope("box")) { if (info.canEdit) { if (GUILayout.Button("R:" + i.ToString(), GUILayout.Width(48))) { info.Remove(data); } if (GUILayout.Button("E:" + i.ToString(), GUILayout.Width(48))) { var window = EditorWindow.GetWindow <FielItemShow>(); window.index = i; window.Show(); } } else { EditorGUILayout.LabelField(i.ToString(), mySkin.GetStyle("ItemButton"), GUILayout.Width(100)); } } for (int j = 0; j < info.dataFields.Length; j++) { using (var scope3 = new EditorGUILayout.HorizontalScope("box")) { var value = info.dataFields[j].GetValue(data); if (value != null) { EditorGUILayout.LabelField(value.ToString(), mySkin.GetStyle("ItemValue"), GUILayout.Width(width)); } else { EditorGUILayout.LabelField("null", mySkin.GetStyle("ItemValue"), GUILayout.Width(width)); } } } } } } } EditorGUILayout.EndScrollView(); using (var scope = new EditorGUILayout.VerticalScope("box")) { if (GUILayout.Button("Add")) { var data = System.Activator.CreateInstance(info.dataType); info.AddData(data); var window = EditorWindow.GetWindow <FielItemShow>(); window.index = info.dataLength - 1; window.Show(); } } }