my script was changed by you but you ended up taking out the point to generated file in unity assetbrowser and saving it to the users speficied unity asset path functionality please restore it and send entire script fixed ty

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine.Networking;
using Unity.EditorCoroutines.Editor;

public class AceStepEditorWindow : EditorWindow
{
    private Texture2D logoTexture;

    // The input object
    private ACEStepInput input = new ACEStepInput()
    {
        checkpoint_path = "",
        bf16 = true,
        torch_compile = false,
        device_id = 0,
        output_path = "",
        audio_duration = 10f,
        prompt = "female singer, edm, drums, bass, techno",
        lyrics = @"[verse]
Thank you for buying my product,
Without you I can't survive,
Thank you for buying my product,
You're my favorite person alive.",
        infer_step = 50,
        guidance_scale = 7.5f,
        scheduler_type = "euler",
        cfg_type = "apg",
        omega_scale = 0f,
        actual_seeds = new List<int>(),  // Empty; user can add via button
        guidance_interval = 1f,
        guidance_interval_decay = 0f,
        min_guidance_scale = 0f,
        use_erg_tag = true,
        use_erg_lyric = false,
        use_erg_diffusion = true,
        oss_steps = new List<int>(),     // Empty; user can add via button
        guidance_scale_text = 0f,
        guidance_scale_lyric = 0f,
    };

    // Server URL (base URL - no trailing slash)
    private string server_url = "http://localhost:8000";

    private Vector2 scrollPos;

    private bool isGenerating = false;
    private string generateStatus = "";

    private ACEStepClientGenerationRunner clientRunner;

    private Rect dragDropAreaRect;

    [MenuItem("Tools/AceStep")]
    public static void ShowWindow()
    {
        var window = GetWindow<AceStepEditorWindow>();
        window.titleContent = new GUIContent("AceStep");
        window.minSize = new Vector2(600, 700);
        window.Show();
    }

    private void OnEnable()
    {
        logoTexture = Resources.Load<Texture2D>("AceStepLogo");
        clientRunner = new ACEStepClientGenerationRunner(this);
    }

    private void OnDisable()
    {
        // No audio cleanup needed anymore
    }

    void OnGUI()
    {
        DrawLogo();

        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

        GUILayout.Space(10);
        DrawFolderDragDropArea();

        GUILayout.Space(10);

        EditorGUILayout.LabelField("Server URL (no trailing slash)", EditorStyles.boldLabel);
        server_url = EditorGUILayout.TextField(server_url);

        GUILayout.Space(10);

        EditorGUILayout.LabelField("ACEStep Parameters", EditorStyles.boldLabel);

        DrawInputFields();

        GUILayout.Space(20);

        EditorGUI.BeginDisabledGroup(isGenerating);
        if (GUILayout.Button("GENERATE SONG", GUILayout.Height(40)))
        {
            if (string.IsNullOrEmpty(input.output_path))
            {
                EditorUtility.DisplayDialog("Error", "Please drag & drop an output folder before generating.", "OK");
            }
            else
            {
                generateStatus = "Starting generation...";
                isGenerating = true;
                clientRunner.GenerateAudio(input, OnGenerationSuccess, OnGenerationError);
            }
        }
        EditorGUI.EndDisabledGroup();

        GUILayout.Space(10);

        if (isGenerating)
        {
            EditorGUILayout.HelpBox(generateStatus, MessageType.Info);
        }
        else if (!string.IsNullOrEmpty(generateStatus))
        {
            EditorGUILayout.HelpBox(generateStatus, MessageType.Info);
        }

        EditorGUILayout.EndScrollView();
    }

    private void DrawLogo()
    {
        if (logoTexture != null)
        {
            float maxWidth = position.width * 0.8f;
            float ratio = (float)logoTexture.height / logoTexture.width;
            float width = Mathf.Min(maxWidth, logoTexture.width);
            float height = width * ratio;

            GUILayout.Space(10);
            Rect rect = GUILayoutUtility.GetRect(width, height, GUILayout.ExpandWidth(false));
            rect.x = (position.width - width) / 2;
            EditorGUI.DrawPreviewTexture(rect, logoTexture, null, ScaleMode.ScaleToFit);
            GUILayout.Space(10);
        }
        else
        {
            EditorGUILayout.HelpBox("Logo 'AceStepLogo.png' not found in Resources folder.", MessageType.Warning);
        }
    }

    private void DrawFolderDragDropArea()
    {
        GUILayout.Label("Output Folder (drag & drop your Unity folder here)", EditorStyles.boldLabel);

        dragDropAreaRect = GUILayoutUtility.GetRect(0, 50, GUILayout.ExpandWidth(true));
        GUI.Box(dragDropAreaRect, string.IsNullOrEmpty(input.output_path) ?
            "Drag & Drop Output Folder Here" : $"Output Folder:\n{input.output_path}", EditorStyles.helpBox);

        Event evt = Event.current;

        if ((evt.type == EventType.DragUpdated || evt.type == EventType.DragPerform) && dragDropAreaRect.Contains(evt.mousePosition))
        {
            DragAndDrop.visualMode = DragAndDropVisualMode.Copy;

            if (evt.type == EventType.DragPerform)
            {
                DragAndDrop.AcceptDrag();

                foreach (var draggedObject in DragAndDrop.objectReferences)
                {
                    string path = AssetDatabase.GetAssetPath(draggedObject);
                    if (!string.IsNullOrEmpty(path) && AssetDatabase.IsValidFolder(path))
                    {
                        input.output_path = path;
                        GUI.FocusControl(null);
                        break;
                    }
                }
                evt.Use();
            }
        }
    }

    private void DrawInputFields()
    {
        input.checkpoint_path = EditorGUILayout.TextField("Checkpoint Path", input.checkpoint_path);

        input.bf16 = EditorGUILayout.Toggle("bf16", input.bf16);
        input.torch_compile = EditorGUILayout.Toggle("torch_compile", input.torch_compile);
        input.device_id = EditorGUILayout.IntField("device_id", input.device_id);

        input.audio_duration = EditorGUILayout.FloatField("audio_duration", input.audio_duration);

        EditorGUILayout.LabelField("Prompt");
        input.prompt = EditorGUILayout.TextArea(input.prompt, GUILayout.Height(60));

        EditorGUILayout.LabelField("Lyrics");
        input.lyrics = EditorGUILayout.TextArea(input.lyrics, GUILayout.Height(60));

        input.infer_step = EditorGUILayout.IntField("infer_step", input.infer_step);
        input.guidance_scale = EditorGUILayout.FloatField("guidance_scale", input.guidance_scale);

        string[] schedulerOptions = new string[] { "euler", "heun" };
        int schedulerSelectedIndex = Array.IndexOf(schedulerOptions, input.scheduler_type);
        if (schedulerSelectedIndex < 0) schedulerSelectedIndex = 0;

        schedulerSelectedIndex = EditorGUILayout.Popup("scheduler_type", schedulerSelectedIndex, schedulerOptions);
        input.scheduler_type = schedulerOptions[schedulerSelectedIndex];

        string[] cfgOptions = new string[] { "cfg", "apg", "cfg_star" };
        int cfgSelectedIndex = Array.IndexOf(cfgOptions, input.cfg_type);
        if (cfgSelectedIndex < 0) cfgSelectedIndex = 1;

        cfgSelectedIndex = EditorGUILayout.Popup("cfg_type", cfgSelectedIndex, cfgOptions);
        input.cfg_type = cfgOptions[cfgSelectedIndex];

        input.omega_scale = EditorGUILayout.FloatField("omega_scale", input.omega_scale);

        DrawIntListField("actual_seeds", input.actual_seeds);

        input.guidance_interval = EditorGUILayout.FloatField("guidance_interval", input.guidance_interval);
        input.guidance_interval_decay = EditorGUILayout.FloatField("guidance_interval_decay", input.guidance_interval_decay);
        input.min_guidance_scale = EditorGUILayout.FloatField("min_guidance_scale", input.min_guidance_scale);

        input.use_erg_tag = EditorGUILayout.Toggle("use_erg_tag", input.use_erg_tag);
        input.use_erg_lyric = EditorGUILayout.Toggle("use_erg_lyric", input.use_erg_lyric);
        input.use_erg_diffusion = EditorGUILayout.Toggle("use_erg_diffusion", input.use_erg_diffusion);

        DrawIntListField("oss_steps", input.oss_steps);

        input.guidance_scale_text = EditorGUILayout.FloatField("guidance_scale_text", input.guidance_scale_text);
        input.guidance_scale_lyric = EditorGUILayout.FloatField("guidance_scale_lyric", input.guidance_scale_lyric);
    }

    private void DrawIntListField(string label, List<int> list)
    {
        EditorGUILayout.LabelField(label);
        if (list == null) list = new List<int>();
        EditorGUI.indentLevel++;

        int removeIndex = -1;
        for (int i = 0; i < list.Count; i++)
        {
            EditorGUILayout.BeginHorizontal();
            list[i] = EditorGUILayout.IntField(list[i]);
            if (GUILayout.Button("-", GUILayout.Width(24)))
            {
                removeIndex = i;
            }
            EditorGUILayout.EndHorizontal();
        }
        if (removeIndex >= 0)
            list.RemoveAt(removeIndex);

        if (GUILayout.Button("+ Add " + label))
            list.Add(0);

        EditorGUI.indentLevel--;
    }

    private void OnGenerationSuccess(ACEStepOutput output)
    {
        generateStatus = "Generation succeeded! File saved: " + output.output_path;
        isGenerating = false;
        Repaint();
    }

    private void OnGenerationError(string errorMsg)
    {
        generateStatus = "Generation failed: " + errorMsg;
        isGenerating = false;
        Repaint();
    }

    class ACEStepClientGenerationRunner : MonoBehaviour
    {
        private static ACEStepClientGenerationRunner _instance;

        private ACEStepClient client;

        public ACEStepClientGenerationRunner(AceStepEditorWindow window)
        {
            if (_instance == null)
            {
                GameObject go = new GameObject("ACEStepClientGenerationRunner");
                go.hideFlags = HideFlags.HideAndDontSave;
                _instance = go.AddComponent<ACEStepClientGenerationRunner>();
            }
            client = _instance.gameObject.GetComponent<ACEStepClient>();
            if (client == null)
                client = _instance.gameObject.AddComponent<ACEStepClient>();
        }

        public void GenerateAudio(ACEStepInput input, Action<ACEStepOutput> onSuccess, Action<string> onError)
        {
            _instance.StartCoroutine(client.GenerateAudioRoutine(input, onSuccess, onError));
        }
    }
}