protected override void DrawEntry(string schemaKey, Dictionary <string, object> schemaData) { float beginningHeight = CurrentHeight(); // Start drawing below if (DrawFoldout(GDEConstants.SchemaLbl + " ", schemaKey, schemaKey, schemaKey, RenameSchema)) { bool shouldDrawSpace = false; bool didDrawSpaceForSection = false; // Draw the basic types foreach (BasicFieldType fieldType in GDEItemManager.BasicFieldTypes) { List <string> fieldKeys = GDEItemManager.SchemaFieldKeysOfType(schemaKey, fieldType.ToString()); foreach (string fieldKey in fieldKeys) { currentLinePosition += GDEConstants.Indent; DrawSingleField(schemaKey, fieldKey, schemaData); shouldDrawSpace = true; } } // Draw the custom types foreach (string fieldKey in GDEItemManager.SchemaCustomFieldKeys(schemaKey)) { if (shouldDrawSpace && !didDrawSpaceForSection) { NewLine(0.5f); didDrawSpaceForSection = true; } currentLinePosition += GDEConstants.Indent; DrawSingleField(schemaKey, fieldKey, schemaData); shouldDrawSpace = true; } didDrawSpaceForSection = false; // Draw the lists foreach (BasicFieldType fieldType in GDEItemManager.BasicFieldTypes) { List <string> fieldKeys = GDEItemManager.SchemaListFieldKeysOfType(schemaKey, fieldType.ToString()); foreach (string fieldKey in fieldKeys) { if (shouldDrawSpace && !didDrawSpaceForSection) { NewLine(0.5f); didDrawSpaceForSection = true; } currentLinePosition += GDEConstants.Indent; DrawListField(schemaKey, schemaData, fieldKey); shouldDrawSpace = true; } } didDrawSpaceForSection = false; // Draw the custom lists foreach (string fieldKey in GDEItemManager.SchemaCustomListFields(schemaKey)) { if (shouldDrawSpace && !didDrawSpaceForSection) { NewLine(0.5f); didDrawSpaceForSection = true; } currentLinePosition += GDEConstants.Indent; DrawListField(schemaKey, schemaData, fieldKey); shouldDrawSpace = true; } // Remove any fields that were deleted above foreach (string deletedKey in deletedFields) { RemoveField(schemaKey, schemaData, deletedKey); } deletedFields.Clear(); // Rename any fields that were renamed string error; string oldFieldKey; string newFieldKey; foreach (KeyValuePair <List <string>, Dictionary <string, object> > pair in renamedFields) { oldFieldKey = pair.Key[0]; newFieldKey = pair.Key[1]; if (!GDEItemManager.RenameSchemaField(oldFieldKey, newFieldKey, schemaKey, pair.Value, out error)) { EditorUtility.DisplayDialog(GDEConstants.ErrorLbl, string.Format("Couldn't rename {0} to {1}: {2}", oldFieldKey, newFieldKey, error), GDEConstants.OkLbl); } } renamedFields.Clear(); NewLine(); DrawAddFieldSection(schemaKey, schemaData); NewLine(2f); GUIContent content = new GUIContent(GDEConstants.DeleteBtn); float width = GUI.skin.button.CalcSize(content).x; if (GUI.Button(new Rect(currentLinePosition, TopOfLine(), width, StandardHeight()), content)) { deletedSchemas.Add(schemaKey); } NewLine(); DrawSectionSeparator(); NewLine(0.25f); } float groupHeight = CurrentHeight() - beginningHeight; SetGroupHeight(schemaKey, groupHeight); }