This package adds the feature of letting the user download arbitrary data as a file or load a local file of the user's choice in the Unity WebGL build.
This project is built with Unity 6000.0.10f1.
This package is made for Unity Package Manager (UPM).
- Open
Window
>Package Manager
window. - Click
+
>Add package from git URL
. - Type
https://github.com/ruccho/BlobIO.git?path=/Packages/io.github.ruccho.blobio
and clickAdd
.
using Ruccho.BlobIO;
public void LoadText()
{
BlobIO.MakeUpload((f) =>
{
Debug.Log($"Filename: \"{f.Filename}\"");
Debug.Log($"Loaded text: {Encoding.UTF8.GetString(f.Data)}");
}, ".txt");
}
public void SaveText(string text)
{
BlobIO.MakeDownloadText(text, "example.txt");
}