Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 1.92 KB

File metadata and controls

50 lines (41 loc) · 1.92 KB

Unity_UriImage

This plugin makes ugui's image support displaying sprite from url, which is based on UnityWebRequest

Installation

I. Use UPM

II. Dowanload unitypackage

Or download the unitypackage and import.

Usage

Create a new UriImage

sc1

Configure URL on unity inspector

1. Load sprite from local disk

sc2

2. Load sprite from remote

sc3

Load Sprite in other script

using SaltyfishKK.UriImage;

public class YourClassOrSomethingElse:MonoBehaviour
{
    [SerializeField]
    private UriImage m_Img;
    
    void DoSomething()
    {
        m_Img.LoadSpriteFromUri("url", UriSourceType.Remote);
    }
}

Use default Image

Only want to use UGUI Image? Then just call these functions.

UriSpriteLoader.Instance.DisplayFromRemote(ImgComponent, "url");
UriSpriteLoader.Instance.DisplayFromFilePath(ImgComponent, "url");

Custom your own ErrorImage

  1. Find the UriImage_Setting scriptable asset.

  2. Modify the DefaultErrorImagePath (relative to Resources Folder).

  3. Put your own sprite asset in the specific folder.

uriimage_setting