Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sprite downloadedSprite;
- IEnumerator GetImages()
- {
- Texture2D _texture;
- UnityWebRequest www = UnityWebRequestTexture.GetTexture(_store.LogoDownloadLink);
- yield return www.SendWebRequest();
- if (www.result != UnityWebRequest.Result.Success)
- {
- Debug.Log(www.error);
- }
- else
- {
- _texture = ((DownloadHandlerTexture)www.downloadHandler).texture;
- Rect _rect = new Rect(0, 0, _texture.width, _texture.height);
- Sprite _sprite = Sprite.Create(_texture, _rect, new Vector2(0.5f, 0.5f), 100);
- downloadedSprite = _sprite;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement