https://github.com/jpgordon00/UnityFileDownloader
Download multiple files at a time in Unity.
https://github.com/jpgordon00/UnityFileDownloader
Last synced: 7 months ago
JSON representation
Download multiple files at a time in Unity.
- Host: GitHub
- URL: https://github.com/jpgordon00/UnityFileDownloader
- Owner: jpgordon00
- License: gpl-3.0
- Created: 2021-02-05T05:49:19.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-12-19T18:07:50.000Z (almost 3 years ago)
- Last Synced: 2024-08-02T05:13:06.698Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 3.2 MB
- Stars: 63
- Watchers: 5
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- anything_about_game - UnityFileDownloader
README
UnityFileDownloader☁️
A file downloader that handles asyncronous and concurrent file downloading, implicit multi-part file downloading, pausing/restarting, properties with per-file granularity and more.
## Appendix
This file downloader was built because UnityWebRequest and recent solutions built by Unity and third-parties are subpar and bare of features. While this project is written 100% in C#, this downloader should support all platforms that Unity does. If you have any feedback, please reach out to me at jpgordon00@gmail.com, or submit an issue or pull request. Collaboration is encouraged!
## Features
- Concurrently download any amount of files while adhering to a fixed number of asyncronous tasks
- Implicitly handles multi-part file downloading, including pausing/restarting of chunked downloads
- Provides both task-based asyncronous methods and standard callbacks for errors, individual file completion, all file completion, and more
- Granularity of properties can be on a per-file basis, providing the ability to pause/restart, and to get/set progress, timeouts, headers, callbacks and more
- Optionally handle "atomic" file downloading by deleting all downloaded (partially or impartially) files and ability to continue downloading through HTTP/S errors
- Code structure that allows for modularity of both download fulfillment (such as UnityWebRequest) and dispatching of downloads.
## Usage/Examples
```javascript
using UFD;
using System;
// ... in some class
public class Example
{
async void Download()
{
UnityFileDownloader ufd = new UnityFileDownloader(new string[] {
"https://wallpaperaccess.com/full/87731.jpg",
});
await ufd.Download();
}
}
```
## Issues
- Unity Editor termination and application lifecycle methods do not stop this downloader from functioning.
## TODO
The following features are some of which I deem to be deseriable and not currently implemented:
- Dynamic chunk sizing based on download speeds
- Cleanup of class structure to provide complete modularity of download fulfillment and downloader.
- Provide alternative fulfillers to UnityWebRequest, perhaps unlocking better platform specific performance.