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

Manage AssetBundles, download avatar AssetBundles from web API, save them in a local folder and load them on demand. For local avatars, the metadata is stored in the AvatarCacheFolder. More...

Static Public Member Functions

static void ResetCache ()
 Clear current cash and reload data using Avatar cache folder.
 
static bool Contains (string avatarName)
 Check if the given avatar is in the cache, ie. localy stored or in resource folder.
 
static AvatarData GetMetadata (string avatarName)
 Returns the metadata for the desired avatar key.

Returns
Null if avatar not found, AvatarData otherwise

 
static void RemoveAvatarMetadata (string avatarName)
 Remove the metadata from an avatar.
 
static List< AvatarDataGetCachedMetadata ()
 Returns all the avatars metadata in the cache.
 
static IEnumerator Download (string avatarName, string provider)
 Download the given avatar and put it in the cache.
 
static void UpdateMetadata (AvatarData avatarData, string path)
 Update avatar metadata after an avatar has been downloaded.
 
static AssetBundleCreateRequest GetAsync (string avatarName)
 Loads and returns the AssetBundle corresponding to the given avatar.
 
static bool IsAvatarAvailable (AvatarData data)
 check if an avatar has an assetbundle for the current pipeline
 

Properties

static string AvatarBundleExtension [get]
 
static IEnumerable< string > Keys [get]
 Returns the Avatars in cache, ie. localy stored.
 

Static Private Member Functions

static void InitializeCache ()
 
static void LoadCachedMetadata ()
 Loads the cache json file.
 
static void SaveMetadata ()
 Save metadata for cached avatars.
 
static IEnumerator WaitUntilFileIsReady (string path)
 Helper method to check whether a file (assetbundle) is being download.
 

Static Private Attributes

static Dictionary< string, string > avatarCache = new Dictionary<string, string>()
 
static Dictionary< string, AvatarDataavatarCacheMetadata = new Dictionary<string, AvatarData>()
 
static string metadataFile = "avatars.json"
 

Detailed Description

Manage AssetBundles, download avatar AssetBundles from web API, save them in a local folder and load them on demand. For local avatars, the metadata is stored in the AvatarCacheFolder.

Member Function Documentation

◆ GetCachedMetadata()

static List< AvatarData > Inria.Avatar.AvatarReady.AvatarCache.GetCachedMetadata ( )
inlinestatic

Returns all the avatars metadata in the cache.

Returns
List of AvatarData in cache

◆ WaitUntilFileIsReady()

static IEnumerator Inria.Avatar.AvatarReady.AvatarCache.WaitUntilFileIsReady ( string path)
inlinestaticprivate

Helper method to check whether a file (assetbundle) is being download.

Parameters
path
Returns

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