//called from base OnGUI, handles child property drawing protected override void DrawChildProperties(Rect position, SerializedProperty property) { //draw label Rect newPosition = DrawTopLabel(position); //draw unique id newPosition = DrawUniqueID(newPosition); //Draw name newPosition = EditorTool.DrawTextArea(newPosition, name, "Text"); //tag header newPosition = EditorTool.DrawLabel(newPosition, "Tag"); //tag newPosition = DrawTag(newPosition); //remove indent newPosition = EditorTool.GetIndentedPosition(newPosition, false); //replies header newPosition = EditorTool.DrawLabel(newPosition, "Replies"); //Draw useDefaultReply newPosition = EditorTool.DrawBoolField(newPosition, useDefaultReply, "Use Default Replies"); isDetailExpaned = useDefaultReply.boolValue; //Draw replies if not default if (isDetailExpaned == false) { newPosition = EditorTool.DrawReorderableList(newPosition, repliesList); } }
protected Rect DrawTag(Rect position) { //Draw tagType Rect newPosition = EditorTool.DrawPropertyField(position, tagType); //add indent newPosition = EditorTool.GetIndentedPosition(newPosition); //Draw necissary fields based on tag type switch (tagType.intValue) { case 2: //Draw id newPosition = EditorTool.DrawIntField(newPosition, id, "ID"); break; case 3: //Draw id newPosition = EditorTool.DrawIntField(newPosition, id, "ID"); break; } return(newPosition); }