This plugin makes ugui's image support displaying sprite from url, which is based on UnityWebRequest
- Open your package manager window and select "add package from git URL".
- Type in "https://github.com/0kk470/Unity_UriImage.git#upm"
Or download the unitypackage and import.
using SaltyfishKK.UriImage;
public class YourClassOrSomethingElse:MonoBehaviour
{
[SerializeField]
private UriImage m_Img;
void DoSomething()
{
m_Img.LoadSpriteFromUri("url", UriSourceType.Remote);
}
}
Only want to use UGUI Image? Then just call these functions.
UriSpriteLoader.Instance.DisplayFromRemote(ImgComponent, "url");
UriSpriteLoader.Instance.DisplayFromFilePath(ImgComponent, "url");
-
Find the UriImage_Setting scriptable asset.
-
Modify the DefaultErrorImagePath (relative to Resources Folder).
-
Put your own sprite asset in the specific folder.