Snapchat Kit for Unity
  • Introduction
  • Installation Troubleshooting
  • Settings
    • Snapchat Kit Settings
  • Usage
    • Namespace
  • API
    • Is Service Available
    • Initialisation
    • Login & Logout
    • Get Snap Profile Data
    • Share Content
    • Add Extra Content(Stickers & Links)
  • Utility Snippets
    • Download Texture from Url
Powered by GitBook
On this page
  1. Utility Snippets

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

using VoxelBusters.SnapchatKit.Common.Utility;

private void DownloadTextureFromUrlPath(string urlPath)
{
    DownloadTexture _newDownload = new DownloadTexture(new URL(urlPath), true, true);
    _newDownload.OnCompletion = (Texture2D _texture, string _error)=>{
        Debug.Log(string.Format("[DownloadAvatar] Texture download completed. Error= {0}.", _error.GetPrintableString()));
        //Access downloaded texture from _texture here. 
        };
        
    // Start the request 
    _newDownload.StartRequest();
}

PreviousAdd Extra Content(Stickers & Links)

Last updated 6 years ago