Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1.     protected IEnumerator LoadTextureFrombytes(string textname,Texture2D loadtex,Action<Texture2D> f,Action<byte[],Texture2D,Action<Texture2D>> SetTex)
  2.     {
  3.         var storageReference = GetReferenceFromImageName(textname);
  4.         Debug.Log("Downloading");
  5.         var task = storageReference.GetBytesAsync(
  6.         0, new StorageProgress<DownloadState>(DisplayDownloadState),
  7.         cancelToken.Token);
  8.         yield return new WaitForTaskCompletion(this, task);
  9.         if (!(task.IsFaulted || task.IsCanceled))
  10.         {
  11.             Debug.Log("finished downloading bytes");
  12.             SetTex(task.Result, loadtex,f);
  13.         }
  14.  
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement