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

Manages the AvatarGallery api. Launch a web request to AvatarGallery API to get the json representation of the avatar database. More...

Static Public Member Functions

static IEnumerator RequestAvatarGalleryJson ()
 Method which tries to download the list of available avatars from the remote server. Coroutine version.
 
static void RequestAvatarGalleryJson (UnityAction< UnityWebRequest.Result > action)
 Method which tries to download the list of available avatars from the remote server. Callback version.
 
static IEnumerator DownloadAssetBundle (string avatarName, string provider, string localPath)
 Tries to download a given avatar from the given provider. If the avatar metadata has not been loaded, it will be query for it. Coroutine version.
 
static void DownloadAssetBundle (string avatarName, string provider, string localPath, UnityAction callback)
 Initiate download of an Asset bundle from Avatar Gallery. Callback version.
 
static List< AvatarDataGetData ()
 Returns the list of the avatar data. The method RequestAvatarGalleryJson should be called in order to initialize the data.
 
static bool TryGetAvatarMetadata (string name, string provider, out AvatarData avatarData)
 Method to recover the metadata of a given avatar.
 

Properties

static string AvatarGalleryURL [get]
 

Static Private Member Functions

static void ProcessDownloadRequest (UnityWebRequest request, string avatarName, string provider, string localPath, UnityAction callback)
 CallBack from a download request of an avatar from Avatar gallery. Used by DownloadAssetBundle.
 
static void ProcessWebRequest (UnityWebRequest apiRequest)
 Helper method to process the web request from avatar-gallery.
 

Static Private Attributes

const int timeout = 10
 
static List< AvatarDataavatars = null
 
static bool requestingGalleryJson = false
 
static bool requestingAvatar = false
 
static UnityEvent< UnityWebRequest.Result > OnReceiveJsonRequest
 
static UnityEvent OnReceiveAvatarRequest
 

Detailed Description

Manages the AvatarGallery api. Launch a web request to AvatarGallery API to get the json representation of the avatar database.

Member Function Documentation

◆ RequestAvatarGalleryJson()

static void Inria.Avatar.AvatarReady.AvatarGalleryApi.RequestAvatarGalleryJson ( UnityAction< UnityWebRequest.Result > action)
inlinestatic

Method which tries to download the list of available avatars from the remote server. Callback version.

Parameters
actionUnity Action taking a UnityWebRequest.Result, Called when request is completed

◆ DownloadAssetBundle() [1/2]

static IEnumerator Inria.Avatar.AvatarReady.AvatarGalleryApi.DownloadAssetBundle ( string avatarName,
string provider,
string localPath )
inlinestatic

Tries to download a given avatar from the given provider. If the avatar metadata has not been loaded, it will be query for it. Coroutine version.

Parameters
avatarNameAvatar name
providerAvatar provider
localPathPath to save the assetBundle

◆ DownloadAssetBundle() [2/2]

static void Inria.Avatar.AvatarReady.AvatarGalleryApi.DownloadAssetBundle ( string avatarName,
string provider,
string localPath,
UnityAction callback )
inlinestatic

Initiate download of an Asset bundle from Avatar Gallery. Callback version.

Parameters
avatarNameAvatar name
providerAvatar provider
localPathPath to save the assetBundle
callbackCallback to call when the download is completed

◆ ProcessWebRequest()

static void Inria.Avatar.AvatarReady.AvatarGalleryApi.ProcessWebRequest ( UnityWebRequest apiRequest)
inlinestaticprivate

Helper method to process the web request from avatar-gallery.

Parameters
apiRequestUnity Web request

◆ GetData()

static List< AvatarData > Inria.Avatar.AvatarReady.AvatarGalleryApi.GetData ( )
inlinestatic

Returns the list of the avatar data. The method RequestAvatarGalleryJson should be called in order to initialize the data.

Returns
List of AvatarData

◆ TryGetAvatarMetadata()

static bool Inria.Avatar.AvatarReady.AvatarGalleryApi.TryGetAvatarMetadata ( string name,
string provider,
out AvatarData avatarData )
inlinestatic

Method to recover the metadata of a given avatar.

Parameters
nameAvatar name
providerAvatar provider
Returns
True if avatar found, false otherwise

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