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
@@ -1,10 +1,3 @@
fileFormatVersion: 2
guid: 97ca8174f0514e8e9ee5d4be26ed8078
timeCreated: 1674416481
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/Buttons/OpenDialogueButton.cs
uploadId: 870414
timeCreated: 1674416481
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/Buttons/OpenURLButton.cs
uploadId: 870414
@@ -1,10 +1,3 @@
fileFormatVersion: 2
guid: 9116854180be4f2b8fcc0422bcf570a5
timeCreated: 1674127121
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/EditorTextures.cs
uploadId: 870414
timeCreated: 1674127121
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/IGUIComponent.cs
uploadId: 870414
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/Options/AllowAndroidAppToMakeHttpRequestsOption.cs
uploadId: 870414
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/Options/Base/HotReloadOptionBase.cs
uploadId: 870414
@@ -1,10 +1,3 @@
fileFormatVersion: 2
guid: 0a626aa97160471f85de4646a634bdf1
timeCreated: 1674574633
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/Options/Base/OptionInterfaces.cs
uploadId: 870414
timeCreated: 1674574633
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/Options/ExposeServerOption.cs
uploadId: 870414
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 254358
packageName: Hot Reload | Edit Code Without Compiling
packageVersion: 1.13.17
assetPath: Packages/com.singularitygroup.hotreload/Editor/Window/GUI/Options/IncludeInBuildOption.cs
uploadId: 870414
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
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/Base/HotReloadTabBase.cs
uploadId: 870414
@@ -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
@@ -264,7 +264,11 @@ namespace SingularityGroup.HotReload.Editor {
OpenURLButton.RenderRaw(new Rect { x = secondLayerX, y = firstLayerY, width = secondLayerWidth, height = buttonHeight }, Translations.About.ButtonUnityForum, Constants.ForumURL, HotReloadWindowStyles.HelpTabButton);
}
using (new EditorGUILayout.HorizontalScope()) {
OpenDialogueButton.RenderRaw(rect: new Rect { x = firstLayerX, y = secondLayerY, width = firstLayerWidth, height = buttonHeight }, text: reportIssueButton.text, url: reportIssueButton.url, title: reportIssueButton.title, message: reportIssueButton.message, ok: reportIssueButton.ok, cancel: reportIssueButton.cancel, style: HotReloadWindowStyles.HelpTabButton);
if (GUI.Button(new Rect { x = firstLayerX, y = secondLayerY, width = firstLayerWidth, height = buttonHeight },
new GUIContent(reportIssueButton.text.StartsWith(" ") ? reportIssueButton.text : " " + reportIssueButton.text), HotReloadWindowStyles.HelpTabButton)
) {
ReportWindowAPI.OpenBugReport();
}
OpenURLButton.RenderRaw(new Rect { x = secondLayerX, y = secondLayerY, width = secondLayerWidth, height = buttonHeight }, discordButton.text, discordButton.url, HotReloadWindowStyles.HelpTabButton);
}
}
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
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/HotReloadAboutTab.cs
uploadId: 870414
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
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/HotReloadOptionsSection.cs
uploadId: 870414
@@ -457,11 +457,16 @@ namespace SingularityGroup.HotReload.Editor {
if (alertEntry.alertType != AlertType.Suggestion && HotReloadWindowStyles.windowScreenWidth > 400 && entryType != EntryType.Child) {
using (new EditorGUILayout.HorizontalScope()) {
var ago = (DateTime.Now - alertEntry.timestamp);
GUI.Label(new Rect(startRect.x + startRect.width - 60, startRect.y, 80, 20), ago.TotalMinutes < 1 ? "now" : $"{(ago.TotalHours > 1 ? $"{Math.Floor(ago.TotalHours)} h " : string.Empty)}{ago.Minutes} min", HotReloadWindowStyles.TimestampStyle);
GUI.Label(new Rect(startRect.x + startRect.width - 60, startRect.y, 80, 20), ago.TotalMinutes < 1 ? Translations.Timeline.EntryTimeNow : $"{(ago.TotalHours > 1 ? $"{Math.Floor(ago.TotalHours)} {Translations.Timeline.EntryTimeHours} " : string.Empty)}{ago.Minutes} {Translations.Timeline.EntryTimeMinutes}", HotReloadWindowStyles.TimestampStyle);
}
}
GUILayout.Space(1f);
if (timelineType == TimelineType.Timeline && !HotReloadPrefs.TimelineViewAll && alertEntry.alertData?.isCompile == true) {
// break on first compile entry if we only viewing recent events
break;
}
}
if (timelineType != TimelineType.Suggestions && HotReloadTimelineHelper.GetRunTabTimelineEventCount() > 40) {
GUILayout.Space(3f);
@@ -549,7 +554,7 @@ namespace SingularityGroup.HotReload.Editor {
text = Translations.Timeline.MessageCompleteRegistration;
} else if (!currentState.running) {
text = Translations.Timeline.MessageUseStartButton;
} else if (enabledFilters.Count < 4 && HotReloadTimelineHelper.EventsTimeline.Count != 0) {
} else if (enabledFilters.Count < 4 && HotReloadTimelineHelper.CountTimelineEnties() != 0) {
text = Translations.Timeline.MessageEnableFilters;
} else {
text = Translations.Timeline.MessageMakeCodeChanges;
@@ -559,7 +564,11 @@ namespace SingularityGroup.HotReload.Editor {
GUILayout.FlexibleSpace();
} else {
GUILayout.FlexibleSpace();
if (HotReloadTimelineHelper.EventsTimeline.Count > 0 && GUILayout.Button(Translations.Common.ButtonClear)) {
if (HotReloadTimelineHelper.CountTimelineEnties() > 0 && GUILayout.Button(HotReloadPrefs.TimelineViewAll ? Translations.Timeline.ViewRecent : Translations.Timeline.ViewAll)) {
HotReloadPrefs.TimelineViewAll = !HotReloadPrefs.TimelineViewAll;
}
if (HotReloadTimelineHelper.CountTimelineEnties() > 0 && GUILayout.Button(Translations.Common.ButtonClear)) {
HotReloadTimelineHelper.ClearEntries();
if (HotReloadWindow.Current) {
HotReloadWindow.Current.Repaint();
@@ -1070,7 +1079,11 @@ namespace SingularityGroup.HotReload.Editor {
OpenURLButton.Render(errInfo.supportButtonText, Constants.ContactURL);
}
if (currentState.loginStatus?.lastLicenseError != null) {
HotReloadAboutTab.reportIssueButton.OnGUI();
var text = HotReloadAboutTab.reportIssueButton.text;
if (GUILayout.Button(new GUIContent(text.StartsWith(" ") ? text : " " + text))) {
ReportWindowAPI.OpenBugReport(title: Translations.BugReport.LicenseActivationFailed, description: string.Format(Translations.BugReport.LicenseActivationFailedWithError, currentState.loginStatus.lastLicenseError));
}
}
}
@@ -1345,7 +1358,7 @@ namespace SingularityGroup.HotReload.Editor {
using (new EditorGUILayout.HorizontalScope()) {
progress = EditorCodePatcher.DownloadProgress;
EditorGUI.ProgressBar(barRect, Mathf.Clamp(progress, 0f, 1f), "");
if (GUI.Button(new Rect(barRect) { x = barRect.x + barRect.width + 5, height = barRect.height, width = 60 }, new GUIContent(" Info", GUIHelper.GetLocalIcon("alert_info")))) {
if (GUI.Button(new Rect(barRect) { x = barRect.x + barRect.width + 5, height = barRect.height, width = 60 }, new GUIContent(" Info", GUIHelper.GetLocalIcon("Hot_Reload_alert_info")))) {
Application.OpenURL(Constants.AdditionalContentURL);
}
}
@@ -9,10 +9,3 @@ MonoImporter:
userData:
assetBundleName:
assetBundleVariant:
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/HotReloadRunTab.cs
uploadId: 870414
@@ -46,8 +46,8 @@ namespace SingularityGroup.HotReload.Editor {
// Resources.Load uses cache, so it's safe to call it every frame.
// Retrying Load every time fixes an issue where you import the package and constructor runs, but resources aren't loadable yet.
private Texture iconCheck => Resources.Load<Texture>("icon_check_circle");
private Texture iconWarning => Resources.Load<Texture>("icon_warning_circle");
private Texture iconCheck => Resources.Load<Texture>("Hot_Reload_icon_check_circle");
private Texture iconWarning => Resources.Load<Texture>("Hot_Reload_icon_warning_circle");
[SuppressMessage("ReSharper", "Unity.UnknownResource")] // Rider doesn't check packages
public HotReloadSettingsTab(HotReloadWindow window) : base(window,
@@ -153,7 +153,6 @@ namespace SingularityGroup.HotReload.Editor {
// misc
RenderMiscHeader();
using (new EditorGUILayout.VerticalScope(paddedStyle ?? (paddedStyle = new GUIStyle { padding = new RectOffset(20, 0, 0, 0) }))) {
RenderAutoClearTimeline();
RenderAutostart();
RenderConsoleWindow();
@@ -199,7 +198,7 @@ namespace SingularityGroup.HotReload.Editor {
DisableDetailedErrorReporting();
PauseHotReloadInEditMode();
#if UNITY_EDITOR_WIN
if (PackageConst.DefaultLocale == RuntimeLocalization.Locale.English) {
if (PackageConst.DefaultLocaleField == Locale.English) {
UseWatchman();
}
#endif
@@ -397,22 +396,6 @@ namespace SingularityGroup.HotReload.Editor {
}
}
void RenderAutoClearTimeline() {
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleAutoClearTimeline), HotReloadPrefs.AutoClearTimeline);
if (newSettings != HotReloadPrefs.AutoClearTimeline) {
HotReloadPrefs.AutoClearTimeline = newSettings;
}
string toggleDescription;
if (HotReloadPrefs.AutoClearTimeline) {
toggleDescription = Translations.Settings.SettingsAutoClearTimelineOn;
} else {
toggleDescription = Translations.Settings.SettingsAutoClearTimelineOff;
}
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
EditorGUILayout.EndToggleGroup();
EditorGUILayout.Space();
}
void RenderAutostart() {
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleAutostart), HotReloadPrefs.LaunchOnEditorStart);
if (newSettings != HotReloadPrefs.LaunchOnEditorStart) {
@@ -919,11 +902,11 @@ namespace SingularityGroup.HotReload.Editor {
}
void DrawDisabledCircle(Rect rect) => DrawCircleIcon(rect,
Resources.Load<Texture>("icon_circle_gray"),
Resources.Load<Texture>("Hot_Reload_icon_circle_gray"),
Color.clear); // smaller circle draws less attention
void DrawBlackCircle(Rect rect) => DrawCircleIcon(rect,
Resources.Load<Texture>("icon_circle_black"),
Resources.Load<Texture>("Hot_Reload_icon_circle_black"),
new Color(0.14f, 0.14f, 0.14f)); // black is too dark in unity light theme
void DrawCircleIcon(Rect rect, Texture circleIcon, Color borderColor) {
@@ -1,10 +1,3 @@
fileFormatVersion: 2
guid: fff71bd159424bf2978e2e99eacba9b4
timeCreated: 1674057842
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/HotReloadSettingsTab.cs
uploadId: 870414
timeCreated: 1674057842