class MyClass : MonoBehaviour {
Init()
{
// Required
Bkpk.ClientID = "XXX";
Bkpk.ResponseType = "token|code";
// Optional
Bkpk.BkpkUrl = "https://bkpk.io";
Bkpk.BkpkApiUrl = "https://api.bkpk.io";
Bkpk.WebSdkUrl = "https://jsdelivr.com/...";
}
}
class MyClass : MonoBehaviour {
// Use this if using the `code` response type
void OnAuthorized(Bkpk.AuthorizationCodeResponse response)
{
// Send these to your backend to exchange them for
// an access token using your client secret
Debug.Log(response.code);
Debug.Log(response.state);
}
async Init()
{
string code = await Bkpk.Auth.GetActivationCode(OnAuthorized)
}
}
class MyClass : MonoBehaviour {
...
async Init()
{
string code = await Bkpk.Auth.RequestAuthorization(OnAuthorized)
}
}
AvatarInfo[] avatars = await Bkpk.Avatars.GetAvatars();
Bkpk.AvatarInfo avatarInfo = await Bkpk.GetDefaultAvatar();
Bkpk.BkpkAvatar avatar = await Bkpk.Avatars.LoadAvatar(avatarInfo);