VRoidSDK.Decorator → Pixiv.VroidSdk.DecoratorVRoidSDK.IO → Pixiv.VroidSdk.IOVRoidSDK.Localize→ Pixiv.VroidSdk.LocalizeVRoidSDK.Networking → Pixiv.VroidSdk.Networking Pixiv.VroidSdk.Networking.UnityVRoidSDK.OAuth → Pixiv.VroidSdk.Oauth Pixiv.VroidSdk.Oauth.DataModel Pixiv.VroidSdk.Unity.Oauth.LegacyVRoidSDK → Pixiv.VroidSdk Pixiv.VroidSdk.Api Pixiv.VroidSdk.Api.DataModel Pixiv.VroidSdk.Api.Legacy Pixiv.VroidSdk.Cache Pixiv.VroidSdk.Unity.Cacheusing Pixiv.VroidSdk.Api.Legacy;
using Pixiv.VroidSdk.Api.DataModel;
private void LoadModel(CharacterModel characterModel, string password)
{
HubModelDeserializer.Instance.LoadCharacterAsync(
characterModel: characterModel,
encryptPassword: password, // Set an encryption password for the model
onLoadComplete: (GameObject characterObj) => onSuccess(characterObject),
onDownloadProgress: (float progress) => onProgress(progress),
onError: (Exception error) => onError(error)
);
// You can use Option to set the number of caches and other details
// However, a password is required
var option = new HubModelDeserializerOption {
MaxCacheCount = 20,
CacheEncryptPassword = password, // Set an encryption password for the model
};
HubModelDeserializer.Instance.LoadCharacterAsync(
characterModel: characterModel,
option: option,
onLoadComplete: (GameObject characterObj) => onSuccess(characterObject),
onDownloadProgress: (float progress) => onProgress(progress),
onError: (Exception error) => onError(error)
);
}
using Pixiv.VroidSdk.Api.DataModel;
public class Model : ApplicationModel
{
// Class declarations are now reference types, so they can't be declared as nullable types
- public Account? CurrentUser { get; set; }
+ public Account CurrentUser { get; set; }
public Model()
{
CurrentUser = null;
}
}
LocalStorage has been removed.
Pixiv.VroidSdk.Cache.ModelDataCache#Fetch and Pixiv.VroidSdk.Cache.ModelDataCache#FetchAsync are used).VRoidSDK.LocalStorage is used in a way other than those intended by VRoid SDK, it will not load correctly and will be deleted.GltfMaterial#extensions response returned by GetCharacterModelsProperty, PostCharacterModelsPropertiesBatch, and others, has been changed from Dictionary<string, object> to GltfMaterialExtensions.public override void Init(GltfMaterial baseData)
{
if (baseData.extensions != null)
{
stringBuilder.Append("\\n");
// v0.0.x returns the Dictionary
foreach (var x in baseData.extensions)
{
stringBuilder.AppendLine("\\t" + x.Key + ":" + x.Value);
}
}
}
public override void Init(GltfMaterial baseData)
{
if (baseData.extensions != null)
{
stringBuilder.Append("\\n");
// After v0.1.0, it returns GltfMaterialExtensions type and determines if KHR_materials_unlit exists
if (baseData.extensions.KHR_materials_unlit != null)
{
stringBuilder.AppendLine("\\t KHR_materials_unlit:{}");
}
}
}
HubModelDeserializer and <0>HubApi</0> now require initialization to be used as before.
HubModelDeserializer is initialized at the same time as HubApi is initialized.class Hoge : MonoBehaviour
{
void Start()
{
HubApi.GetAccountCharacterModels(
count: 10,
onSuccess: (List<CharacterModel> characterModels) => {
HubModelDeserializer.Instance.LoadCharacterAsync(
characterModel: characterModels[0],
onDownloadProgress: (float progress) => {
},
onLoadComplete: (GameObject characterObj) => {
characterObj.transform.parent = this.transform;
},
onError: (Exception error) => {
}
);
},
onError: (ApiErrorFormat errorFormat) => { /* When an error occurs (e.g. communication error) */ }
);
}
}
The following classes have been deprecated. There are alternatives to each of these, so please consider switching to them.
VRoidSDK.Authentication → Pixiv.VroidSdk.OauthProvider Pixiv.VroidSdk.Oauth.ClientBrowserAuthorizer → Pixiv.VroidSdk.BrowserProvider Pixiv.VroidSdk.Browser.*VRoidSDK.SDKConfiguration → Pixiv.VroidSdk.Oauth.DataModel Pixiv.VroidSdk.Environments.*VRoidSDK.HubApi → Pixiv.VroidSdk.Api.DefaultApi Pixiv.VroidSdk.Api.HeartApiVRoidSDK.HubModelDeserializer → Pixiv.VroidSdk.ModelLoaderTo set the previous SDK, you had to enter the application ID and Secret in the SDKConfiguration, but this is deprecated starting from 0.1.0.
Instead, please download and use the file credential.json.bytes from the application management page.
Pixiv.VroidSdk.OauthProvider Pixiv.VroidSdk.Oauth.ClientPixiv.VroidSdk.Api.DefaultApi Pixiv.VroidSdk.Api.HeartApiPixiv.VroidSdk.ModelLoaderawait, the thread context will change, so if you use Unity’s API, use SynchronizationContext.Current to specify the thread context before execution.UnityWebRequest or HttpClient.Pixiv.VroidSdk.Unity.Networking.Drivers.UnityWebRequestDriver or Pixiv.VroidSdk.Networking.Drivers.HttpClientDriver.Authentication doesn’t support this method, please try implementing the new feature as described in “3.1 Implementing a new interface for authorization, API execution, and model loading”.ASWebAuthenticationSession in Xcode 12.5 or later.