Helper class to load avatars from AssetBundles.
More...
|
static IEnumerator | ApplyAvatar (AvatarReadySetup avatarReadyTarget, string avatarName, string provider, Action OnAvatarLoaded=null, Action OnLoadingFail=null) |
| Method that loads the prefab which matches the avatarName and the current avatar provider of the AvatarReadySetup. Then calls to ApplyAvatar(AvatarReadySetup, GameObject, Action)
|
|
static IEnumerator | ApplyAvatar (AvatarReadySetup avatarReadyTarget, GameObject avatarPrefab, Action OnAvatarLoaded=null) |
| Method which instantiates an avatar prefab and configures it.
|
|
static IEnumerator | LoadAssetbundle (string avatarName, Type avatarProvider) |
| Pre-loads an avatar assetbundle to memory for rapid access.
|
|
static IEnumerator | LoadFromResource (string avatarName, Type avatarProvider) |
| Load an avatar from resources.
|
|
static string | GetProvider (AvatarReady avatarReady) |
| Get the provider for an avatar.
|
|
static string | GetProvider (Type avatarProviderType) |
| Get the provider from a provider type.
|
|
static Type | GetProvider (string providerName) |
| Get the provider type from a provider string name.
|
|
|
static Dictionary< string, GameObject > | avatarPrefabCache = new Dictionary<string, GameObject>() |
|
static List< string > | ongoingRequests = new List<string>() |
|
Helper class to load avatars from AssetBundles.
The main functions are:
- ApplyAvatar, which loads a given avatar into an AvatarReadySetup configuration. It loads an avatar based on name and provider
- PreLoadAvatar, pre-loads a prefab of an avatar to separate the loading of the loading process.
◆ ApplyAvatar() [1/2]
static IEnumerator Inria.Avatar.AvatarReady.AvatarReadyRuntimeImportHelper.ApplyAvatar |
( |
AvatarReadySetup | avatarReadyTarget, |
|
|
string | avatarName, |
|
|
string | provider, |
|
|
Action | OnAvatarLoaded = null, |
|
|
Action | OnLoadingFail = null ) |
|
inlinestatic |
Method that loads the prefab which matches the avatarName and the current avatar provider of the AvatarReadySetup. Then calls to ApplyAvatar(AvatarReadySetup, GameObject, Action)
- Parameters
-
avatarReadyTarget | Target AvatarReadySetup |
avatarName | Name of the avatar |
provider | Provider of the avatar |
OnAvatarLoaded | Optional action to be performed once the avatar is loaded |
OnLoadingFail | Optional call to be performed when loading fails |
◆ ApplyAvatar() [2/2]
static IEnumerator Inria.Avatar.AvatarReady.AvatarReadyRuntimeImportHelper.ApplyAvatar |
( |
AvatarReadySetup | avatarReadyTarget, |
|
|
GameObject | avatarPrefab, |
|
|
Action | OnAvatarLoaded = null ) |
|
inlinestatic |
Method which instantiates an avatar prefab and configures it.
- Parameters
-
avatarReadyTarget | |
avatarPrefab | |
OnAvatarLoaded | |
◆ LoadAssetbundle()
static IEnumerator Inria.Avatar.AvatarReady.AvatarReadyRuntimeImportHelper.LoadAssetbundle |
( |
string | avatarName, |
|
|
Type | avatarProvider ) |
|
inlinestatic |
Pre-loads an avatar assetbundle to memory for rapid access.
- Parameters
-
avatarName | Name of the avatar |
avatarProvider | Provider |
◆ GetProvider() [1/3]
static string Inria.Avatar.AvatarReady.AvatarReadyRuntimeImportHelper.GetProvider |
( |
AvatarReady | avatarReady | ) |
|
|
inlinestatic |
Get the provider for an avatar.
- Parameters
-
avatarReady | The avatar for which you want to get the provider |
- Returns
- String name of the provider
◆ GetProvider() [2/3]
static string Inria.Avatar.AvatarReady.AvatarReadyRuntimeImportHelper.GetProvider |
( |
Type | avatarProviderType | ) |
|
|
inlinestatic |
Get the provider from a provider type.
- Parameters
-
avatarProviderType | The provider type which you want to get the provider name |
- Returns
- String name of the provider
- Exceptions
-
NotSupportedException | Throw Not Supported Exception if type is not defined |
◆ GetProvider() [3/3]
static Type Inria.Avatar.AvatarReady.AvatarReadyRuntimeImportHelper.GetProvider |
( |
string | providerName | ) |
|
|
inlinestatic |
Get the provider type from a provider string name.
- Parameters
-
providerName | string name of the provider |
- Returns
- The provider type
- Exceptions
-
NotSupportedException | Throw Not Supported Exception if provider name is not defined |
The documentation for this class was generated from the following file:
- AvatarReadyRuntimeImportHelper.cs