private void ExportControls() { StratusEditorGUI.BeginAligned(TextAlignment.Center); { StratusEditorGUILayout.Button("Export", () => { if (this.hasPreset && this.preset.arguments.valid) { Export(this.preset.arguments); } }); //StratusEditorGUILayout.Button("Export To", () => //{ // string path = StratusEditorGUILayout.FolderPath("Export"); // if (path.IsValid()) // { // if (this.hasPreset && this.preset.arguments.valid) // { // Export(preset.arguments); // } // } //}); } StratusEditorGUI.EndAligned(); }
/// <summary> /// Draws a property (really, a field) serialized by Odin Serializer /// </summary> /// <param name="property"></param> /// <returns></returns> public bool DrawSerializedProperty(StratusSerializedField property) { bool changed = false; EditorGUI.BeginChangeCheck(); { if (property.isList) { //Debug.Log($"Now drawing the list { property.displayName}"); this.reorderableLists[this.customSerializedPropertyModels[property]].DoLayoutList(); } else { changed |= StratusEditorGUILayout.Field(property.field, this.target); } } if (EditorGUI.EndChangeCheck()) { //StratusDebug.Log($"Detected change on {property.displayName}"); EditorUtility.SetDirty(this.target); // Record change Undo.RecordObject(this.target, property.field.Name); // Apply the modified property this.serializedObject.ApplyModifiedProperties(); changed = true; } return(changed); }