protected override void OnCreatePreset(string[] input) { presetDescription.stringValue = input[1]; serializedObject.ApplyModifiedProperties(); Preset newPreset = new Preset(asset as AudioFileMusicObject); newPreset.excludedProperties = new string[] { "file", "files", "useLibrary", "category" }; string path = JSAMSettings.Settings.PresetsPath + "/" + input[0] + ".preset"; JSAMEditorHelper.CreateAssetSafe(newPreset, path); }
void GenerateAudioFileObjects <T>(Preset preset) where T : BaseAudioFileObject { string folder = outputFolder.stringValue; for (int i = 0; i < asset.files.Count; i++) { var newObject = CreateInstance <T>(); preset.ApplyTo(newObject); newObject.file = asset.files[i]; string finalPath = folder + "/" + asset.files[i].name + ".asset"; JSAMEditorHelper.CreateAssetSafe(newObject, finalPath); } EditorUtility.FocusProjectWindow(); }