Download Texture from Url
Learn how to download a texture form url
If you want to download the texture from the url, you can make use of DownloadTexture class provided in VoxelBusters.SnapchatKit.Common.Utility namespace
1
using VoxelBusters.SnapchatKit.Common.Utility;
2
3
private void DownloadTextureFromUrlPath(string urlPath)
4
{
5
DownloadTexture _newDownload = new DownloadTexture(new URL(urlPath), true, true);
6
_newDownload.OnCompletion = (Texture2D _texture, string _error)=>{
7
Debug.Log(string.Format("[DownloadAvatar] Texture download completed. Error= {0}.", _error.GetPrintableString()));
8
//Access downloaded texture from _texture here.
9
};
10
11
// Start the request
12
_newDownload.StartRequest();
13
}
Copied!
Last modified 2yr ago
Copy link