Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected IEnumerator LoadTextureFrombytes(string textname,Texture2D loadtex,Action<Texture2D> f,Action<byte[],Texture2D,Action<Texture2D>> SetTex)
- {
- var storageReference = GetReferenceFromImageName(textname);
- Debug.Log("Downloading");
- var task = storageReference.GetBytesAsync(
- 0, new StorageProgress<DownloadState>(DisplayDownloadState),
- cancelToken.Token);
- yield return new WaitForTaskCompletion(this, task);
- if (!(task.IsFaulted || task.IsCanceled))
- {
- Debug.Log("finished downloading bytes");
- SetTex(task.Result, loadtex,f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement