protected override void DrawEntry(string key, Dictionary <string, object> data) { float beginningHeight = CurrentHeight(); string schemaType = "<unknown>"; object temp; if (data.TryGetValue(GDMConstants.SchemaKey, out temp)) { schemaType = temp as string; } // Start drawing below if (DrawFoldout(schemaType + ":", key, key, key, RenameItem)) { bool shouldDrawSpace = false; bool didDrawSpaceForSection = false; // Draw the basic types foreach (BasicFieldType fieldType in GDEItemManager.BasicFieldTypes) { List <string> fieldKeys = GDEItemManager.ItemFieldKeysOfType(key, fieldType.ToString()); foreach (string fieldKey in fieldKeys) { currentLinePosition += GDEConstants.Indent; DrawSingleField(schemaType, fieldKey, data); shouldDrawSpace = true; } } // Draw the custom types foreach (string fieldKey in GDEItemManager.ItemCustomFieldKeys(key)) { if (shouldDrawSpace && !didDrawSpaceForSection) { NewLine(0.5f); didDrawSpaceForSection = true; } currentLinePosition += GDEConstants.Indent; DrawSingleField(schemaType, fieldKey, data); shouldDrawSpace = true; } didDrawSpaceForSection = false; // Draw the lists foreach (BasicFieldType fieldType in GDEItemManager.BasicFieldTypes) { List <string> fieldKeys = GDEItemManager.ItemListFieldKeysOfType(key, fieldType.ToString()); foreach (string fieldKey in fieldKeys) { if (shouldDrawSpace && !didDrawSpaceForSection) { NewLine(0.5f); didDrawSpaceForSection = true; } currentLinePosition += GDEConstants.Indent; DrawListField(schemaType, key, fieldKey, data); shouldDrawSpace = true; } } didDrawSpaceForSection = false; // Draw the custom lists foreach (string fieldKey in GDEItemManager.ItemCustomListFields(key)) { if (shouldDrawSpace && !didDrawSpaceForSection) { NewLine(0.5f); didDrawSpaceForSection = true; } currentLinePosition += GDEConstants.Indent; DrawListField(schemaType, key, fieldKey, data); shouldDrawSpace = true; } NewLine(0.5f); GUIContent content = new GUIContent(GDEConstants.DeleteBtn); float width = GUI.skin.button.CalcSize(content).x; if (GUI.Button(new Rect(currentLinePosition, TopOfLine(), width, StandardHeight()), content)) { deletedItems.Add(key); } NewLine(); DrawSectionSeparator(); NewLine(0.25f); } else { // Collapse any list foldouts as well List <string> listKeys = GDEItemManager.ItemListFieldKeys(key); string foldoutKey; foreach (string listKey in listKeys) { foldoutKey = string.Format(GDMConstants.MetaDataFormat, key, listKey); listFieldFoldoutState.Remove(foldoutKey); } } float newGroupHeight = CurrentHeight() - beginningHeight; float currentGroupHeight; groupHeights.TryGetValue(key, out currentGroupHeight); // Set the minimum height for the schema type if (currentGroupHeight.NearlyEqual(GDEConstants.LineHeight) && !newGroupHeight.NearlyEqual(GDEConstants.LineHeight)) { SetSchemaHeight(schemaType, newGroupHeight); } SetGroupHeight(key, newGroupHeight); }