Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Runtime/WebView/Data/UrlConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class UrlConfig
private const string TAG = nameof(UrlConfig);
private const string CLEAR_CACHE_PARAM = "clearCache";
private const string FRAME_API_PARAM = "frameApi";
private const string SOURCE_PARAM = "source";
private const string QUICK_START_PARAM = "quickStart";
private const string SELECT_BODY_PARAM = "selectBodyType";
private const string LOGIN_TOKEN_PARAM = "token";
Expand Down Expand Up @@ -41,6 +42,13 @@ public string BuildUrl(string loginToken = "")
var builder = new StringBuilder($"https://{CoreSettingsHandler.CoreSettings.Subdomain}.readyplayer.me/");
builder.Append(language != Language.Default ? $"{language.GetValue()}/" : string.Empty);
builder.Append($"avatar?{FRAME_API_PARAM}");
#if UNITY_ANDROID
builder.Append($"&{SOURCE_PARAM}=unity-android-avatar-creator");
#elif UNITY_IOS
builder.Append($"&{SOURCE_PARAM}=unity-ios-avatar-creator");
#else
builder.Append($"&{SOURCE_PARAM}=unity-avatar-creator");
#endif
builder.Append(clearCache ? $"&{CLEAR_CACHE_PARAM}" : string.Empty);
if (loginToken != string.Empty)
{
Expand Down
20 changes: 10 additions & 10 deletions Tests/Editor/UrlConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ namespace ReadyPlayerMe.Core.Tests
public class UrlConfigTests : MonoBehaviour
{
private static readonly string URL_BASE = $"https://{CoreSettingsHandler.CoreSettings.Subdomain}.readyplayer.me";
private readonly string URL_DEFAULT = $"{URL_BASE}/avatar?frameApi&selectBodyType";
private readonly string URL_LANG_GERMAN = $"{URL_BASE}/de/avatar?frameApi&selectBodyType";
private readonly string URL_LANG_BRAZIL = $"{URL_BASE}/pt-BR/avatar?frameApi&selectBodyType";
private readonly string URL_DEFAULT = $"{URL_BASE}/avatar?frameApi&source=unity-avatar-creator&selectBodyType";
private readonly string URL_LANG_GERMAN = $"{URL_BASE}/de/avatar?frameApi&source=unity-avatar-creator&selectBodyType";
private readonly string URL_LANG_BRAZIL = $"{URL_BASE}/pt-BR/avatar?frameApi&source=unity-avatar-creator&selectBodyType";

private readonly string URL_GENDER_MALE = $"{URL_BASE}/avatar?frameApi&gender=male&selectBodyType";
private readonly string URL_GENDER_NONE = $"{URL_BASE}/avatar?frameApi&gender=male&selectBodyType";
private readonly string URL_GENDER_MALE = $"{URL_BASE}/avatar?frameApi&source=unity-avatar-creator&gender=male&selectBodyType";
private readonly string URL_GENDER_NONE = $"{URL_BASE}/avatar?frameApi&source=unity-avatar-creator&gender=male&selectBodyType";

private readonly string URL_TYPE_FULLBODY = $"{URL_BASE}/avatar?frameApi&bodyType=fullbody";
private readonly string URL_TYPE_HALFBODY = $"{URL_BASE}/avatar?frameApi&bodyType=halfbody";
private readonly string URL_TYPE_FULLBODY = $"{URL_BASE}/avatar?frameApi&source=unity-avatar-creator&bodyType=fullbody";
private readonly string URL_TYPE_HALFBODY = $"{URL_BASE}/avatar?frameApi&source=unity-avatar-creator&bodyType=halfbody";

private readonly string URL_CLEAR_CACHE = $"{URL_BASE}/avatar?frameApi&clearCache&selectBodyType";
private readonly string URL_CLEAR_CACHE = $"{URL_BASE}/avatar?frameApi&source=unity-avatar-creator&clearCache&selectBodyType";

private readonly string URL_QUICK_START = $"{URL_BASE}/avatar?frameApi&quickStart";
private readonly string URL_TOKEN = $"{URL_BASE}/avatar?frameApi&token=TOKEN&selectBodyType";
private readonly string URL_QUICK_START = $"{URL_BASE}/avatar?frameApi&source=unity-avatar-creator&quickStart";
private readonly string URL_TOKEN = $"{URL_BASE}/avatar?frameApi&source=unity-avatar-creator&token=TOKEN&selectBodyType";
private const string LOGIN_TOKEN = "TOKEN";

public UrlConfig config;
Expand Down