Class ModelLoader
Model load utility
In principle, callback called asynchronously
Anything with Async will be executed asynchronously, success result Task will be returned
Inherited Members
Namespace: Pixiv.VroidSdk
Assembly: VRoidSDK.dll
Syntax
public static class ModelLoader
Methods
Initialize(ISdkConfig, IDownloadLicensePublishable, String, UInt32, SynchronizationContext)
初期化
Declaration
public static void Initialize(ISdkConfig config, IDownloadLicensePublishable downloadApi, string cacheEncryptPassword, uint maxCacheCount = 10U, SynchronizationContext context = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ISdkConfig | config | VRoid SDKの利用設定 |
| IDownloadLicensePublishable | downloadApi | ダウンロードAPIをリクエストするクライアント |
| String | cacheEncryptPassword | モデルデータを暗号化するアプリケーション固有の任意文字列 |
| UInt32 | maxCacheCount | 保持するモデルの最大数 |
| SynchronizationContext | context | メインスレッドのSynchronizationContext |
LoadVrm(CharacterModel, Action<GameObject>, Action<Single>, Action<ModelLoadFailException>, IMaterialDescriptorGenerator)
Load VRM model
Declaration
public static void LoadVrm(CharacterModel characterModel, Action<GameObject> onSuccess, Action<float> onProgress, Action<ModelLoadFailException> onFailed, IMaterialDescriptorGenerator materialGenerator = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CharacterModel | characterModel | Model to download |
| Action<GameObject> | onSuccess | Success callback |
| Action<Single> | onProgress | Progress callback |
| Action<ModelLoadFailException> | onFailed | Failure callback |
| IMaterialDescriptorGenerator | materialGenerator | MaterialDescriptorGenerator used when loading VRM |
Remarks
Load from cache if cache exists on device Carry out download if cache doe not exist
Exceptions
| Type | Condition |
|---|---|
| Exception | Exception thrown when ModelLoader is not initialized |
See Also
LoadVrmAsync(CharacterModel, Action<Single>, IMaterialDescriptorGenerator)
Load VRM model
Declaration
public static async Task<GameObject> LoadVrmAsync(CharacterModel characterModel, Action<float> onProgress, IMaterialDescriptorGenerator materialGenerator = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CharacterModel | characterModel | Model to download |
| Action<Single> | onProgress | Progress callback |
| IMaterialDescriptorGenerator | materialGenerator |
Returns
| Type | Description |
|---|---|
| Task<GameObject> |
Remarks
Load from cache if cache exists on device Carry out download if cache doe not exist
Exceptions
| Type | Condition |
|---|---|
| Exception | Exception thrown when ModelLoader is not initialized |