|
@@ -321,12 +321,16 @@ public class DownloadManager : SingletonMono<DownloadManager>
|
|
|
}
|
|
|
StartCoroutine(LoadImage(data, (tex) =>
|
|
|
{
|
|
|
- Sprite sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
|
|
|
- if (image != null)
|
|
|
+ if(tex)
|
|
|
{
|
|
|
- image.sprite = sprite;
|
|
|
+ Sprite sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
|
|
|
+ if (image != null)
|
|
|
+ {
|
|
|
+ image.sprite = sprite;
|
|
|
+ image.transform.localScale = new Vector3(1, (float)tex.height / (float)tex.width, 1);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- image.transform.localScale = new Vector3(1, (float)tex.height / (float)tex.width, 1);
|
|
|
}));
|
|
|
}
|
|
|
|