Update HotReload

This commit is contained in:
2026-03-28 12:54:41 +07:00
parent f2173d2c73
commit a4f2654d0b
278 changed files with 2027 additions and 1896 deletions
@@ -6,10 +6,11 @@ using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using SingularityGroup.HotReload.DTO;
using SingularityGroup.HotReload.Editor.Localization;
using SingularityGroup.HotReload.Localization;
using SingularityGroup.HotReload.Newtonsoft.Json;
using UnityEditor;
using UnityEngine;
using Translations = SingularityGroup.HotReload.Editor.Localization.Translations;
namespace SingularityGroup.HotReload.Editor {
internal enum RedeemStage {
@@ -166,7 +167,7 @@ namespace SingularityGroup.HotReload.Editor {
error = validationError;
return;
}
var resp = await RequestRedeem(email: email, invoiceNumber: invoiceNumber);
var resp = await RequestRedeem(email: email, invoiceNumber: invoiceNumber, isChina: PackageConst.DefaultLocale == Locale.SimplifiedChinese);
status = resp?.status;
if (status != null) {
if (status != statusSuccess && status != statusAlreadyClaimed) {
@@ -210,14 +211,15 @@ namespace SingularityGroup.HotReload.Editor {
}
}
async Task<RedeemResponse> RequestRedeem(string email, string invoiceNumber) {
async Task<RedeemResponse> RequestRedeem(string email, string invoiceNumber, bool isChina) {
requestingRedeem = true;
await ThreadUtility.SwitchToThreadPool();
try {
redeemClient = redeemClient ?? (redeemClient = HttpClientUtils.CreateHttpClient());
var input = new Dictionary<string, string> {
var input = new Dictionary<string, object> {
{ "email", email },
{ "invoice", invoiceNumber }
{ "invoice", invoiceNumber },
{ "isChina", isChina },
};
var content = new StringContent(JsonConvert.SerializeObject(input), Encoding.UTF8, "application/json");
using (var resp = await redeemClient.PostAsync(redeemUrl, content, HotReloadWindow.Current.cancelToken).ConfigureAwait(false)) {
@@ -1,10 +1,3 @@
fileFormatVersion: 2
guid: ad73f74d3c494c02aae937e2dfa305a2
timeCreated: 1689791373
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/Tabs/Helpers/RedeemLicenseHelper.cs
uploadId: 870414
timeCreated: 1689791373