public static Task DownloadTask(string uri, Callback.Download callback) { Task task = new Task(uri, "", null, Type.Download); task.preview = new AudioPreview(uri); task.preview.onDowloaded += () => { task.status = Status.Completed; task.time = EditorApplication.timeSinceStartup; callback.Invoke(task.preview.data, Error.None); }; task.error = Error.None; task.status = Status.Downloading; return(task); }
public static Task DownloadClip(string uri, Callback.Download callback) { return(Task.DownloadTask(uri, callback)); }