Skip to content

0kk470/Unity_UriImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

 
 
 

Languages