AvatarReady
Loading...
Searching...
No Matches
Inria.Avatar.AvatarReady.AvatarPreviewCache Class Reference

Manages preview pictures of avatar from AvatarGallery. Download them from web server, save them in local folder, load them on demand. More...

Static Public Member Functions

static IEnumerator Load (string url)
 Load preview image form cache, local folder or download preview image.
 
static Texture Get (string url)
 Get texture from preview cache.
 
static IEnumerator LoadMatching (string name)
 Check if cache contains matching preview image else download matching preview image.
 
static Texture GetMatching (string name)
 Get preview image matching avatar name from cache.
 
static void LoadOrDownload (string name, UnityAction< Texture > Callback)
 Load or download preview image. Callback.
 
static void Load (string name, UnityAction< Texture > Callback)
 Load preview image form preview cache folder.
 

Static Public Attributes

static string previewImageSufix = "_entier"
 

Static Private Member Functions

static bool ContainsMatching (string name)
 Check if Avatar preview cach contains value for name + Preview image sufix.
 
static IEnumerator LoadPreviewImage (string url)
 Load preview image from preview cache folder.
 
static IEnumerator DownloadPreviewImage (string url)
 Download preview image from avatar gallery.
 
static IEnumerator LoadMatchingPreviewImage (string name)
 
static void Download (string name, UnityAction< Texture > Callback)
 Download preview image from avatar gallery. Callback.
 
static void ProcessLoadWebRequest (UnityWebRequest apiRequest, string name, UnityAction< Texture > Callback)
 Callback from Load webRequest.
 
static void ProcessDownloadWebRequest (UnityWebRequest webRequest, string name, UnityAction< Texture > Callback)
 Callback from Download webRequest.
 

Static Private Attributes

static Dictionary< string, Texture > avatarPreviewCache = new Dictionary<string, Texture>()
 Cache preview url with preview texture.
 

Detailed Description

Manages preview pictures of avatar from AvatarGallery. Download them from web server, save them in local folder, load them on demand.

Member Function Documentation

◆ Load()

static IEnumerator Inria.Avatar.AvatarReady.AvatarPreviewCache.Load ( string url)
inlinestatic

Load preview image form cache, local folder or download preview image.

Parameters
urlAvatar name

◆ Get()

static Texture Inria.Avatar.AvatarReady.AvatarPreviewCache.Get ( string url)
inlinestatic

Get texture from preview cache.

Parameters
urlURL of the image value
Returns
Null if image is not in cache

◆ LoadMatching()

static IEnumerator Inria.Avatar.AvatarReady.AvatarPreviewCache.LoadMatching ( string name)
inlinestatic

Check if cache contains matching preview image else download matching preview image.

Parameters
nameName of the avatar

◆ GetMatching()

static Texture Inria.Avatar.AvatarReady.AvatarPreviewCache.GetMatching ( string name)
inlinestatic

Get preview image matching avatar name from cache.

Parameters
nameName of the avatar
Returns
Matching avatar preview image. Null if matching preview image not found

◆ ContainsMatching()

static bool Inria.Avatar.AvatarReady.AvatarPreviewCache.ContainsMatching ( string name)
inlinestaticprivate

Check if Avatar preview cach contains value for name + Preview image sufix.

Parameters
nameAvatar Name
Returns
avatarPreviewCache has key that contains name + previewImageSufix

The documentation for this class was generated from the following file: