maint: hotreload updated to 1.13.7
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System;
|
using System;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor.Cli {
|
namespace SingularityGroup.HotReload.Editor.Cli {
|
||||||
internal static class CliUtils {
|
internal static class CliUtils {
|
||||||
@@ -66,8 +67,14 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
|
|
||||||
public static string GetExecutableTargetDir() {
|
public static string GetExecutableTargetDir() {
|
||||||
if (PackageConst.IsAssetStoreBuild) {
|
if (PackageConst.IsAssetStoreBuild) {
|
||||||
|
if (PackageConst.DefaultLocaleField == Locale.SimplifiedChinese) {
|
||||||
|
return Path.Combine(GetAppDataPath(), "asset-store", "zh", $"executables_{PackageConst.ServerVersion.Replace('.', '-')}");
|
||||||
|
}
|
||||||
return Path.Combine(GetAppDataPath(), "asset-store", $"executables_{PackageConst.ServerVersion.Replace('.', '-')}");
|
return Path.Combine(GetAppDataPath(), "asset-store", $"executables_{PackageConst.ServerVersion.Replace('.', '-')}");
|
||||||
}
|
}
|
||||||
|
if (PackageConst.DefaultLocaleField == Locale.SimplifiedChinese) {
|
||||||
|
return Path.Combine(GetAppDataPath(), "zh", $"executables_{PackageConst.ServerVersion.Replace('.', '-')}");
|
||||||
|
}
|
||||||
return Path.Combine(GetAppDataPath(), $"executables_{PackageConst.ServerVersion.Replace('.', '-')}");
|
return Path.Combine(GetAppDataPath(), $"executables_{PackageConst.ServerVersion.Replace('.', '-')}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,11 @@ using System.Net.NetworkInformation;
|
|||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
#endif
|
#endif
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
|
using Translations = SingularityGroup.HotReload.Editor.Localization.Translations;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor.Cli {
|
namespace SingularityGroup.HotReload.Editor.Cli {
|
||||||
[InitializeOnLoad]
|
[InitializeOnLoad]
|
||||||
@@ -73,10 +76,9 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
static bool TryGetStartArgs(string dataPath, bool exposeServerToNetwork, bool allAssetChanges, bool createNoWindow, bool isReleaseMode, bool detailedErrorReporting, LoginData loginData, int port, out StartArgs args) {
|
static bool TryGetStartArgs(string dataPath, bool exposeServerToNetwork, bool allAssetChanges, bool createNoWindow, bool isReleaseMode, bool detailedErrorReporting, LoginData loginData, int port, out StartArgs args) {
|
||||||
string serverDir;
|
string serverDir;
|
||||||
if(!CliUtils.TryFindServerDir(out serverDir)) {
|
if(!CliUtils.TryFindServerDir(out serverDir)) {
|
||||||
Log.Warning($"Failed to start the Hot Reload Server. " +
|
Log.Warning(string.Format(Translations.Errors.WarningFailedToStartServer,
|
||||||
$"Unable to locate the 'Server' directory. " +
|
Translations.Utility.UnableToLocateServer +
|
||||||
$"Make sure the 'Server' directory is " +
|
Translations.Utility.UnableToLocateServerDetail));
|
||||||
$"somewhere in the Assets folder inside a 'HotReload' folder or in the HotReload package");
|
|
||||||
args = null;
|
args = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -100,11 +102,11 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
var info = new DirectoryInfo(Path.GetFullPath("."));
|
var info = new DirectoryInfo(Path.GetFullPath("."));
|
||||||
slnPath = Path.Combine(Path.GetFullPath("."), info.Name + ".sln");
|
slnPath = Path.Combine(Path.GetFullPath("."), info.Name + ".sln");
|
||||||
if (!File.Exists(slnPath)) {
|
if (!File.Exists(slnPath)) {
|
||||||
Log.Warning($"Failed to start the Hot Reload Server. Cannot find solution file. Please disable \"useBuiltInProjectGeneration\" in settings to enable custom project generation.");
|
Log.Warning(string.Format(Translations.Errors.WarningFailedToStartServer, Translations.Utility.CannotFindSolutionFile));
|
||||||
args = null;
|
args = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Log.Info("Using default project generation. If you encounter any problem with Unity's default project generation consider disabling it to use custom project generation.");
|
Log.Info(Translations.Errors.InfoDefaultProjectGeneration);
|
||||||
try {
|
try {
|
||||||
Directory.Delete(ProjectGeneration.ProjectGeneration.tempDir, true);
|
Directory.Delete(ProjectGeneration.ProjectGeneration.tempDir, true);
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
@@ -115,7 +117,7 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!File.Exists(slnPath)) {
|
if (!File.Exists(slnPath)) {
|
||||||
Log.Warning($"No .sln file found. Open any c# file to generate it so Hot Reload can work properly");
|
Log.Warning(Translations.Errors.WarningNoSlnFileFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
var searchAssemblies = string.Join(";", CodePatcher.I.GetAssemblySearchPaths());
|
var searchAssemblies = string.Join(";", CodePatcher.I.GetAssemblySearchPaths());
|
||||||
@@ -207,10 +209,10 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
PrepareBuildInfo(buildInfo);
|
PrepareBuildInfo(buildInfo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (!didLogWarning) {
|
if (!didLogWarning) {
|
||||||
Log.Warning($"Preparing build info failed! On-device functionality might not work. Exception: {e}");
|
Log.Warning(string.Format(Translations.Errors.WarningPreparingBuildInfoFailed, e));
|
||||||
didLogWarning = true;
|
didLogWarning = true;
|
||||||
} else {
|
} else {
|
||||||
Log.Debug($"Preparing build info failed! On-device functionality might not work. Exception: {e}");
|
Log.Debug(string.Format(Translations.Utility.PreparingBuildInfoFailed, e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using Debug = UnityEngine.Debug;
|
using Debug = UnityEngine.Debug;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor.Cli {
|
namespace SingularityGroup.HotReload.Editor.Cli {
|
||||||
@@ -45,7 +46,7 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
if (File.Exists(cliargsfile)) {
|
if (File.Exists(cliargsfile)) {
|
||||||
File.Delete(cliargsfile);
|
File.Delete(cliargsfile);
|
||||||
}
|
}
|
||||||
throw new Exception("Could not start code patcher process.");
|
throw new Exception(Translations.Errors.ExceptionCouldNotStartCodePatcher);
|
||||||
}
|
}
|
||||||
codePatcherProc.BeginErrorReadLine();
|
codePatcherProc.BeginErrorReadLine();
|
||||||
codePatcherProc.BeginOutputReadLine();
|
codePatcherProc.BeginOutputReadLine();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using SingularityGroup.HotReload.Editor.Semver;
|
using SingularityGroup.HotReload.Editor.Semver;
|
||||||
using Debug = UnityEngine.Debug;
|
using Debug = UnityEngine.Debug;
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
return macosVersion;
|
return macosVersion;
|
||||||
}
|
}
|
||||||
// should never happen
|
// should never happen
|
||||||
Log.Warning("Failed to detect MacOS version, if Hot Reload fails to start, please contact support.");
|
Log.Warning(Translations.Errors.WarningMacOSVersionDetectionFailed);
|
||||||
return SemVersion.None;
|
return SemVersion.None;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -84,6 +85,10 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
Arguments = args.cliArguments,
|
Arguments = args.cliArguments,
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var pidFilePath = CliUtils.GetPidFilePath(args.hotreloadTempDir);
|
||||||
|
// ReSharper disable once PossibleNullReferenceException
|
||||||
|
File.WriteAllText(pidFilePath, process.Id.ToString());
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,14 +119,14 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
|
|
||||||
if (process.WaitForExit(1000)) {
|
if (process.WaitForExit(1000)) {
|
||||||
if (process.ExitCode != 0) {
|
if (process.ExitCode != 0) {
|
||||||
Log.Warning("Failed to the run the start server command. ExitCode={0}\nFilepath: {1}", process.ExitCode, executableScriptPath);
|
Log.Warning(Translations.Errors.WarningFailedToRunServerCommand, process.ExitCode, executableScriptPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
process.EnableRaisingEvents = true;
|
process.EnableRaisingEvents = true;
|
||||||
process.Exited += (_, __) => {
|
process.Exited += (_, __) => {
|
||||||
if (process.ExitCode != 0) {
|
if (process.ExitCode != 0) {
|
||||||
Log.Warning("Failed to the run the start server command. ExitCode={0}\nFilepath: {1}", process.ExitCode, executableScriptPath);
|
Log.Warning(Translations.Errors.WarningFailedToRunServerCommand, process.ExitCode, executableScriptPath);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -141,11 +146,11 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
static void UnzipMacOsPackage(string zipPath, string unzippedFolderPath) {
|
static void UnzipMacOsPackage(string zipPath, string unzippedFolderPath) {
|
||||||
//Log.Info("UnzipMacOsPackage called with {0}\n workingDirectory = {1}", zipPath, unzippedFolderPath);
|
//Log.Info("UnzipMacOsPackage called with {0}\n workingDirectory = {1}", zipPath, unzippedFolderPath);
|
||||||
if (!zipPath.EndsWith(".zip")) {
|
if (!zipPath.EndsWith(".zip")) {
|
||||||
throw new ArgumentException($"Expected to end with .zip, but it was: {zipPath}", nameof(zipPath));
|
throw new ArgumentException(string.Format(Translations.Errors.ExceptionExpectedZipFile, zipPath), nameof(zipPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!File.Exists(zipPath)) {
|
if (!File.Exists(zipPath)) {
|
||||||
throw new ArgumentException($"zip file not found {zipPath}", nameof(zipPath));
|
throw new ArgumentException(string.Format(Translations.Errors.ExceptionZipFileNotFound, zipPath), nameof(zipPath));
|
||||||
}
|
}
|
||||||
var processStartInfo = new ProcessStartInfo {
|
var processStartInfo = new ProcessStartInfo {
|
||||||
FileName = "unzip",
|
FileName = "unzip",
|
||||||
@@ -158,7 +163,7 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
Process process = Process.Start(processStartInfo);
|
Process process = Process.Start(processStartInfo);
|
||||||
process.WaitForExit();
|
process.WaitForExit();
|
||||||
if (process.ExitCode != 0) {
|
if (process.ExitCode != 0) {
|
||||||
throw new Exception($"unzip failed with ExitCode {process.ExitCode}");
|
throw new Exception(string.Format(Translations.Errors.ExceptionUnzipFailed, process.ExitCode));
|
||||||
}
|
}
|
||||||
//Log.Info($"did unzip to {unzippedFolderPath}");
|
//Log.Info($"did unzip to {unzippedFolderPath}");
|
||||||
// Move the .app folder to unzippedFolderPath
|
// Move the .app folder to unzippedFolderPath
|
||||||
@@ -181,7 +186,7 @@ namespace SingularityGroup.HotReload.Editor.Cli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!done) {
|
if (!done) {
|
||||||
throw new Exception("Failed to find .app directory and move it to " + destDir);
|
throw new Exception(string.Format(Translations.Errors.ExceptionFailedToFindAppDirectory, destDir));
|
||||||
}
|
}
|
||||||
//Log.Info($"did unzip to {unzippedFolderPath}");
|
//Log.Info($"did unzip to {unzippedFolderPath}");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -30,7 +31,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
} catch(FileNotFoundException) {
|
} catch(FileNotFoundException) {
|
||||||
//file doesn't exist -> no recompile required
|
//file doesn't exist -> no recompile required
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
Log.Warning("compile checker encountered issue: {0} {1}", ex.GetType().Name, ex.Message);
|
Log.Warning(Translations.Errors.WarningCompileCheckerIssue, ex.GetType().Name, ex.Message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
|
using Translations = SingularityGroup.HotReload.Editor.Localization.Translations;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal static class Constants {
|
internal static class Constants {
|
||||||
public const string WebsiteURL = "https://hotreload.net";
|
public const string WebsiteURL = PackageConst.DefaultLocale == Locale.SimplifiedChinese ?
|
||||||
|
"https://hotreload.net/zh" :
|
||||||
|
"https://hotreload.net";
|
||||||
public const string ProductPurchaseURL = WebsiteURL + "/pricing";
|
public const string ProductPurchaseURL = WebsiteURL + "/pricing";
|
||||||
public const string ProductPurchaseBusinessURL = ProductPurchaseURL + "?tab=business";
|
public const string ProductPurchaseBusinessURL = ProductPurchaseURL + "?tab=business";
|
||||||
public const string DocumentationURL = WebsiteURL + "/documentation";
|
public const string DocumentationURL = WebsiteURL + "/documentation";
|
||||||
@@ -14,7 +18,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
public const string ManageAccountURL = "https://users.licensespring.com/login";
|
public const string ManageAccountURL = "https://users.licensespring.com/login";
|
||||||
public const string ForgotPasswordURL = "https://users.licensespring.com/reset-password";
|
public const string ForgotPasswordURL = "https://users.licensespring.com/reset-password";
|
||||||
public const string ReportIssueURL = "https://gitlab.com/singularitygroup/hot-reload-for-unity/-/issues/new";
|
public const string ReportIssueURL = "https://gitlab.com/singularitygroup/hot-reload-for-unity/-/issues/new";
|
||||||
public const string TroubleshootingURL = "https://hotreload.net/documentation/troubleshooting";
|
public const string TroubleshootingURL = DocumentationURL + "/troubleshooting";
|
||||||
public const string RecompileTroubleshootingURL = TroubleshootingURL + "#unity-recompiles-every-time-i-enterexit-playmode";
|
public const string RecompileTroubleshootingURL = TroubleshootingURL + "#unity-recompiles-every-time-i-enterexit-playmode";
|
||||||
public const string FeaturesDocumentationURL = DocumentationURL + "/features";
|
public const string FeaturesDocumentationURL = DocumentationURL + "/features";
|
||||||
public const string MultipleEditorsURL = DocumentationURL + "/multiple-editors";
|
public const string MultipleEditorsURL = DocumentationURL + "/multiple-editors";
|
||||||
@@ -39,6 +43,6 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
public const int ConsumptionsHideWidth = 300;
|
public const int ConsumptionsHideWidth = 300;
|
||||||
public const int ConsumptionsHideHeight = 360;
|
public const int ConsumptionsHideHeight = 360;
|
||||||
|
|
||||||
public const string Only40EntriesShown = "Only last 40 entries are shown";
|
public static string Only40EntriesShown => Translations.Timeline.MessageOnly40EntriesShown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,15 +10,15 @@ using SingularityGroup.HotReload.DTO;
|
|||||||
using SingularityGroup.HotReload.Editor.Cli;
|
using SingularityGroup.HotReload.Editor.Cli;
|
||||||
using SingularityGroup.HotReload.Editor.Demo;
|
using SingularityGroup.HotReload.Editor.Demo;
|
||||||
using SingularityGroup.HotReload.EditorDependencies;
|
using SingularityGroup.HotReload.EditorDependencies;
|
||||||
using SingularityGroup.HotReload.RuntimeDependencies;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Debug = UnityEngine.Debug;
|
using Debug = UnityEngine.Debug;
|
||||||
using Task = System.Threading.Tasks.Task;
|
using Task = System.Threading.Tasks.Task;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using SingularityGroup.HotReload.ZXing;
|
using UnityEditor.Build;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
using UnityEditor.UIElements;
|
using UnityEditor.UIElements;
|
||||||
using UnityEditorInternal;
|
using UnityEditorInternal;
|
||||||
@@ -99,6 +99,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
//Avoid infinite recursion in case the static constructor gets accessed via `InitPatchesBlocked` below
|
//Avoid infinite recursion in case the static constructor gets accessed via `InitPatchesBlocked` below
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Translations.LoadDefaultLocalization();
|
||||||
|
SingularityGroup.HotReload.Localization.Translations.LoadDefaultLocalization();
|
||||||
if (File.Exists(PackageConst.ConfigFileName)) {
|
if (File.Exists(PackageConst.ConfigFileName)) {
|
||||||
config = JsonConvert.DeserializeObject<Config>(File.ReadAllText(PackageConst.ConfigFileName));
|
config = JsonConvert.DeserializeObject<Config>(File.ReadAllText(PackageConst.ConfigFileName));
|
||||||
} else {
|
} else {
|
||||||
@@ -121,7 +123,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable ExpressionIsAlwaysNull
|
// ReSharper disable ExpressionIsAlwaysNull
|
||||||
UnityFieldHelper.Init(Log.Warning, HotReloadRunTab.Recompile, DrawOdinInspectorInfo, OdinPropertyDrawInfo, OdinPropertyDrawPrefixInfo, GetDrawVInspectorInfo(), typeof(UnityFieldDrawerPatchHelper));
|
UnityFieldHelper.Init(Log.Warning, HotReloadRunTab.Recompile, DrawOdinInspectorInfo, OdinPropertyDrawInfo, OdinPropertyDrawPrefixInfo, GetDrawVInspectorInfo(), typeof(UnityFieldDrawerPatchHelper), typeof(VisualElement));
|
||||||
|
|
||||||
timer = new Timer(OnIntervalThreaded, (Action) OnIntervalMainThread, 500, 500);
|
timer = new Timer(OnIntervalThreaded, (Action) OnIntervalMainThread, 500, 500);
|
||||||
|
|
||||||
@@ -144,6 +146,33 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
HotReloadTimelineHelper.PersistTimeline();
|
HotReloadTimelineHelper.PersistTimeline();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CompilationPipeline.assemblyCompilationFinished += (string _, CompilerMessage[] messages) => {
|
||||||
|
foreach (var message in messages) {
|
||||||
|
if (message.type != CompilerMessageType.Error) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!message.message.Contains("Sirenix")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (message.message.Contains("CS0012")
|
||||||
|
|| message.message.Contains("CS0234")
|
||||||
|
|| message.message.Contains("CS0246")
|
||||||
|
|| message.message.Contains("CS9286")
|
||||||
|
) {
|
||||||
|
#if UNITY_2021_1_OR_NEWER
|
||||||
|
var target = NamedBuildTarget.FromBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
|
||||||
|
var symbols = PlayerSettings.GetScriptingDefineSymbols(target).Split(";").ToList();
|
||||||
|
symbols.Remove("ODIN_INSPECTOR");
|
||||||
|
PlayerSettings.SetScriptingDefineSymbols(target, string.Join(";", symbols));
|
||||||
|
#else
|
||||||
|
var symbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup).Split(';').ToList();
|
||||||
|
symbols.Remove("ODIN_INSPECTOR");
|
||||||
|
PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, string.Join(";", symbols));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
CompilationPipeline.compilationFinished += obj => {
|
CompilationPipeline.compilationFinished += obj => {
|
||||||
// reset in case package got removed
|
// reset in case package got removed
|
||||||
// if it got removed, it will not be enabled again
|
// if it got removed, it will not be enabled again
|
||||||
@@ -240,18 +269,22 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
&& (!HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges || HotReloadTimelineHelper.PartiallySupportedChangesCount == 0)
|
&& (!HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges || HotReloadTimelineHelper.PartiallySupportedChangesCount == 0)
|
||||||
|| _compileError
|
|| _compileError
|
||||||
|| isPlaying && !HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode
|
|| isPlaying && !HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode
|
||||||
|
|| !isPlaying && !HotReloadPrefs.AutoRecompileUnsupportedChangesInEditMode
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
RecompileUnsupportedChanges();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RecompileUnsupportedChanges() {
|
||||||
if (HotReloadPrefs.ShowCompilingUnsupportedNotifications) {
|
if (HotReloadPrefs.ShowCompilingUnsupportedNotifications) {
|
||||||
EditorWindowHelper.ShowNotification(EditorWindowHelper.NotificationStatus.NeedsRecompile);
|
EditorWindowHelper.ShowNotification(EditorWindowHelper.NotificationStatus.NeedsRecompile);
|
||||||
}
|
}
|
||||||
if (isPlaying) {
|
if (EditorApplication.isPlaying) {
|
||||||
HotReloadState.RecompiledUnsupportedChangesInPlaymode = true;
|
HotReloadState.RecompiledUnsupportedChangesInPlaymode = true;
|
||||||
}
|
}
|
||||||
HotReloadRunTab.Recompile();
|
HotReloadRunTab.Recompile();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DateTime lastPrepareBuildInfo = DateTime.UtcNow;
|
private static DateTime lastPrepareBuildInfo = DateTime.UtcNow;
|
||||||
@@ -341,10 +374,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (!ServerHealthCheck.I.IsServerHealthy) {
|
if (!ServerHealthCheck.I.IsServerHealthy) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var restartServer = EditorUtility.DisplayDialog("Hot Reload",
|
var restartServer = EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleRestartServer,
|
||||||
$"When updating Hot Reload, the server must be restarted for the update to take effect." +
|
Translations.Dialogs.DialogMessageRestartUpdate,
|
||||||
"\nDo you want to restart it now?",
|
Translations.Dialogs.DialogButtonRestartServer, Translations.Dialogs.DialogButtonDontRestart);
|
||||||
"Restart server", "Don't restart");
|
|
||||||
if (restartServer) {
|
if (restartServer) {
|
||||||
RestartCodePatcher().Forget();
|
RestartCodePatcher().Forget();
|
||||||
}
|
}
|
||||||
@@ -389,6 +421,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (response == null || disableServerLogs) {
|
if (response == null || disableServerLogs) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!Application.isPlaying && HotReloadPrefs.PauseHotReloadInEditMode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach (var responseWarning in response.warnings) {
|
foreach (var responseWarning in response.warnings) {
|
||||||
if (responseWarning.Contains("Scripts have compile errors")) {
|
if (responseWarning.Contains("Scripts have compile errors")) {
|
||||||
if (compileError) {
|
if (compileError) {
|
||||||
@@ -432,6 +467,20 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
startupProgress = null;
|
startupProgress = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ServerHealthCheck.I.IsServerHealthy) {
|
||||||
|
stopping = false;
|
||||||
|
}
|
||||||
|
if (startupProgress?.Item1 == 1) {
|
||||||
|
starting = false;
|
||||||
|
}
|
||||||
|
if (!_requestingFlushErrors && Running) {
|
||||||
|
RequestFlushErrors().Forget();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Application.isPlaying && HotReloadPrefs.PauseHotReloadInEditMode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (HotReloadPrefs.AutoDisableHotReloadWithDebugger && Debugger.IsAttached) {
|
if (HotReloadPrefs.AutoDisableHotReloadWithDebugger && Debugger.IsAttached) {
|
||||||
if (!HotReloadState.ShowedDebuggerCompatibility) {
|
if (!HotReloadState.ShowedDebuggerCompatibility) {
|
||||||
HotReloadSuggestionsHelper.SetSuggestionActive(HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached);
|
HotReloadSuggestionsHelper.SetSuggestionActive(HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached);
|
||||||
@@ -440,7 +489,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (CodePatcher.I.OriginalPatchMethods.Count() > 0) {
|
if (CodePatcher.I.OriginalPatchMethods.Count() > 0) {
|
||||||
if (!Application.isPlaying) {
|
if (!Application.isPlaying) {
|
||||||
if (!loggedDebuggerRecompile) {
|
if (!loggedDebuggerRecompile) {
|
||||||
Log.Info("Debugger was attached. Hot Reload may interfere with your debugger session. Recompiling in order to get full debugger experience.");
|
Log.Info(Translations.Errors.InfoDebuggerAttached);
|
||||||
loggedDebuggerRecompile = true;
|
loggedDebuggerRecompile = true;
|
||||||
}
|
}
|
||||||
HotReloadRunTab.Recompile();
|
HotReloadRunTab.Recompile();
|
||||||
@@ -483,15 +532,6 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!ServerHealthCheck.I.IsServerHealthy) {
|
|
||||||
stopping = false;
|
|
||||||
}
|
|
||||||
if (startupProgress?.Item1 == 1) {
|
|
||||||
starting = false;
|
|
||||||
}
|
|
||||||
if (!_requestingFlushErrors && Running) {
|
|
||||||
RequestFlushErrors().Forget();
|
|
||||||
}
|
|
||||||
CheckEditorSettings();
|
CheckEditorSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,7 +559,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
if (newInlinedMethods?.Count > 0) {
|
if (newInlinedMethods?.Count > 0) {
|
||||||
if (!HotReloadPrefs.LoggedInlinedMethodsDialogue) {
|
if (!HotReloadPrefs.LoggedInlinedMethodsDialogue) {
|
||||||
Log.Warning("Unity Editor inlines simple methods when it's in \"Release\" mode, which Hot Reload cannot patch.\n\nSwitch to Debug mode to avoid this problem, or let Hot Reload fully recompile Unity when this issue occurs.");
|
Log.Warning(Translations.Errors.WarningInlinedMethods);
|
||||||
HotReloadPrefs.LoggedInlinedMethodsDialogue = true;
|
HotReloadPrefs.LoggedInlinedMethodsDialogue = true;
|
||||||
}
|
}
|
||||||
HotReloadTimelineHelper.CreateInlinedMethodsEntry(entryType: EntryType.Foldout, patchedMethodsDisplayNames: newInlinedMethods.Select(mb => $"{mb.DeclaringType?.Name}::{mb.Name}").ToArray());
|
HotReloadTimelineHelper.CreateInlinedMethodsEntry(entryType: EntryType.Foldout, patchedMethodsDisplayNames: newInlinedMethods.Select(mb => $"{mb.DeclaringType?.Name}::{mb.Name}").ToArray());
|
||||||
@@ -533,7 +573,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Debug, StatFeature.Patching, StatEventType.Inlined)).Forget();
|
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Debug, StatFeature.Patching, StatEventType.Inlined)).Forget();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.Warning($"Inline method checker ran into an exception. Please contact support with the exception message to investigate the problem. Exception: {e.Message}");
|
Log.Warning(Translations.Errors.WarningInlineMethodChecker, e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -606,12 +646,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// ignore temp compile files
|
// ignore temp compile files
|
||||||
if (assetPath.Contains("UnityDirMonSyncFile") || assetPath.EndsWith("~", StringComparison.Ordinal)) {
|
if (assetPath.Contains("UnityDirMonSyncFile")
|
||||||
|
|| assetPath.EndsWith("~", StringComparison.Ordinal)
|
||||||
|
|| assetPath.Contains("StreamingAssets")
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach (var compileFile in compileFiles) {
|
foreach (var compileFile in compileFiles) {
|
||||||
if (assetPath.EndsWith(compileFile, StringComparison.Ordinal)) {
|
if (assetPath.EndsWith(compileFile, StringComparison.Ordinal)) {
|
||||||
HotReloadTimelineHelper.CreateErrorEventEntry($"errors: AssemblyFileEdit: Editing assembly files requires recompiling in Unity. in {assetPath}", entryType: EntryType.Foldout);
|
HotReloadTimelineHelper.CreateErrorEventEntry(string.Format(Translations.Utility.AssemblyFileEditError, assetPath), entryType: EntryType.Foldout);
|
||||||
_applyingFailed = true;
|
_applyingFailed = true;
|
||||||
if (HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately || UnityEditorInternal.InternalEditorUtility.isApplicationActive) {
|
if (HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately || UnityEditorInternal.InternalEditorUtility.isApplicationActive) {
|
||||||
TryRecompileUnsupportedChanges();
|
TryRecompileUnsupportedChanges();
|
||||||
@@ -622,7 +665,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
// Add plugin changes to unsupported changes list
|
// Add plugin changes to unsupported changes list
|
||||||
foreach (var plugin in plugins) {
|
foreach (var plugin in plugins) {
|
||||||
if (assetPath.EndsWith(plugin, StringComparison.Ordinal)) {
|
if (assetPath.EndsWith(plugin, StringComparison.Ordinal)) {
|
||||||
HotReloadTimelineHelper.CreateErrorEventEntry($"errors: NativePluginEdit: Editing native plugins requires recompiling in Unity. in {assetPath}", entryType: EntryType.Foldout);
|
HotReloadTimelineHelper.CreateErrorEventEntry(string.Format(Translations.Utility.NativePluginEditError, assetPath), entryType: EntryType.Foldout);
|
||||||
_applyingFailed = true;
|
_applyingFailed = true;
|
||||||
if (HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately || UnityEditorInternal.InternalEditorUtility.isApplicationActive) {
|
if (HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately || UnityEditorInternal.InternalEditorUtility.isApplicationActive) {
|
||||||
TryRecompileUnsupportedChanges();
|
TryRecompileUnsupportedChanges();
|
||||||
@@ -660,7 +703,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
|
AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
|
||||||
}
|
}
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
Log.Warning($"Refreshing asset at path: {assetPath} failed due to exception: {e}");
|
Log.Warning(Translations.Errors.WarningRefreshingAssetFailed, assetPath, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -780,7 +823,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lastCompileErrorLog != null) {
|
if (lastCompileErrorLog != null) {
|
||||||
Log.Error(lastCompileErrorLog);
|
if (!disableServerLogs) {
|
||||||
|
Log.Error(lastCompileErrorLog);
|
||||||
|
}
|
||||||
lastCompileErrorLog = null;
|
lastCompileErrorLog = null;
|
||||||
}
|
}
|
||||||
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Debug, StatFeature.Reload, StatEventType.CompileError), new EditorExtraData {
|
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Debug, StatFeature.Reload, StatEventType.CompileError), new EditorExtraData {
|
||||||
@@ -839,6 +884,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}).Forget();
|
}).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!autoRecompiled && patchResult?.inspectorFieldAdded == true && HotReloadPrefs.AutoRecompileInspectorFieldsEdit && !Application.isPlaying) {
|
||||||
|
HotReloadSuggestionsHelper.SetSuggestionsShown(HotReloadSuggestionKind.UnsupportedChanges);
|
||||||
|
RecompileUnsupportedChanges();
|
||||||
|
autoRecompiled = true;
|
||||||
|
HotReloadTimelineHelper.CreateErrorEventEntry(Translations.Utility.InspectorFieldChangeError, entryType: EntryType.Child);
|
||||||
|
HotReloadTimelineHelper.CreateReloadFinishedWithWarningsEventEntry();
|
||||||
|
Log.Info(Translations.Errors.InfoInspectorFieldRecompile);
|
||||||
|
}
|
||||||
|
|
||||||
// When patching different assembly, compile error will get removed, even though it's still there
|
// When patching different assembly, compile error will get removed, even though it's still there
|
||||||
// It's a shortcut we take for simplicity
|
// It's a shortcut we take for simplicity
|
||||||
if (!_compileError) {
|
if (!_compileError) {
|
||||||
@@ -846,7 +900,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (string responseFailure in response.failures) {
|
foreach (string responseFailure in response.failures) {
|
||||||
if (responseFailure.Contains("error CS")) {
|
if (responseFailure.Contains("error CS") && !disableServerLogs) {
|
||||||
Log.Error(responseFailure);
|
Log.Error(responseFailure);
|
||||||
} else if (autoRecompiled) {
|
} else if (autoRecompiled) {
|
||||||
Log.Info(responseFailure);
|
Log.Info(responseFailure);
|
||||||
@@ -924,9 +978,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
foreach (var patch in response.patches) {
|
foreach (var patch in response.patches) {
|
||||||
if(patch.unityJobs.Length > 0) {
|
if(patch.unityJobs.Length > 0) {
|
||||||
Debug.LogWarning("A unity job was hot reloaded. " +
|
Debug.LogWarning(string.Format(Translations.Errors.WarningUnityJobHotReloaded, Constants.TroubleshootingURL));
|
||||||
"This will cause a harmless warning that can be ignored. " +
|
|
||||||
$"More info about this can be found here: {Constants.TroubleshootingURL}");
|
|
||||||
HotReloadPrefs.LoggedBurstHint = true;
|
HotReloadPrefs.LoggedBurstHint = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1013,7 +1065,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
RecordActiveDaysForRateApp();
|
RecordActiveDaysForRateApp();
|
||||||
try {
|
try {
|
||||||
requestingStart = true;
|
requestingStart = true;
|
||||||
startupProgress = Tuple.Create(0f, "Starting Hot Reload");
|
startupProgress = Tuple.Create(0f, Translations.UI.StartingHotReloadMessage);
|
||||||
serverStartedAt = DateTime.UtcNow;
|
serverStartedAt = DateTime.UtcNow;
|
||||||
await HotReloadCli.StartAsync(exposeToNetwork, allAssetChanges, disableConsoleWindow, isReleaseMode, detailedErrorReporting, loginData).ConfigureAwait(false);
|
await HotReloadCli.StartAsync(exposeToNetwork, allAssetChanges, disableConsoleWindow, isReleaseMode, detailedErrorReporting, loginData).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@@ -1123,10 +1175,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
bool consumptionsChanged = Status?.freeSessionRunning != resp.freeSessionRunning || Status?.freeSessionEndTime != resp.freeSessionEndTime;
|
bool consumptionsChanged = Status?.freeSessionRunning != resp.freeSessionRunning || Status?.freeSessionEndTime != resp.freeSessionEndTime;
|
||||||
bool expiresAtChanged = Status?.licenseExpiresAt != resp.licenseExpiresAt;
|
bool expiresAtChanged = Status?.licenseExpiresAt != resp.licenseExpiresAt;
|
||||||
if (!EditorCodePatcher.LoginNotRequired
|
if (!EditorCodePatcher.LoginNotRequired
|
||||||
|
&& !resp.isLicensed
|
||||||
&& resp.consumptionsUnavailableReason == ConsumptionsUnavailableReason.UnrecoverableError
|
&& resp.consumptionsUnavailableReason == ConsumptionsUnavailableReason.UnrecoverableError
|
||||||
&& Status?.consumptionsUnavailableReason != ConsumptionsUnavailableReason.UnrecoverableError
|
&& Status?.consumptionsUnavailableReason != ConsumptionsUnavailableReason.UnrecoverableError
|
||||||
) {
|
) {
|
||||||
Log.Error("Free charges unavailabe. Please contact support if the issue persists.");
|
Log.Error(Translations.Errors.ErrorFreeChargesUnavailable);
|
||||||
}
|
}
|
||||||
if (!RequestingLoginInfo && resp.requestError == null) {
|
if (!RequestingLoginInfo && resp.requestError == null) {
|
||||||
Status = resp;
|
Status = resp;
|
||||||
@@ -1139,7 +1192,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
var oldStartupProgress = startupProgress;
|
var oldStartupProgress = startupProgress;
|
||||||
var newStartupProgress = Tuple.Create(
|
var newStartupProgress = Tuple.Create(
|
||||||
resp.startupProgress,
|
resp.startupProgress,
|
||||||
string.IsNullOrEmpty(resp.startupStatus) ? "Starting Hot Reload" : resp.startupStatus);
|
string.IsNullOrEmpty(resp.startupStatus) ? Translations.UI.StartingHotReloadMessage : resp.startupStatus);
|
||||||
|
|
||||||
startupProgress = newStartupProgress;
|
startupProgress = newStartupProgress;
|
||||||
// ReSharper disable once CompareOfFloatsByEqualityOperator
|
// ReSharper disable once CompareOfFloatsByEqualityOperator
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using SingularityGroup.HotReload.DTO;
|
using SingularityGroup.HotReload.DTO;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal static class EditorIndicationState {
|
internal static class EditorIndicationState {
|
||||||
@@ -21,6 +23,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
ActivationFailed,
|
ActivationFailed,
|
||||||
FinishRegistration,
|
FinishRegistration,
|
||||||
Undetected,
|
Undetected,
|
||||||
|
Paused,
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static readonly string greyIconPath = "grey";
|
internal static readonly string greyIconPath = "grey";
|
||||||
@@ -30,6 +33,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
// grey icon:
|
// grey icon:
|
||||||
{ IndicationStatus.FinishRegistration, greyIconPath },
|
{ IndicationStatus.FinishRegistration, greyIconPath },
|
||||||
{ IndicationStatus.Stopped, greyIconPath },
|
{ IndicationStatus.Stopped, greyIconPath },
|
||||||
|
{ IndicationStatus.Paused, greyIconPath },
|
||||||
// green icon:
|
// green icon:
|
||||||
{ IndicationStatus.Started, greenIconPath },
|
{ IndicationStatus.Started, greenIconPath },
|
||||||
// log icons:
|
// log icons:
|
||||||
@@ -55,22 +59,23 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
// NOTE: if you add longer text, make sure UI is wide enough for it
|
// NOTE: if you add longer text, make sure UI is wide enough for it
|
||||||
public static readonly Dictionary<IndicationStatus, string> IndicationText = new Dictionary<IndicationStatus, string> {
|
public static Dictionary<IndicationStatus, string> IndicationText => new Dictionary<IndicationStatus, string> {
|
||||||
{ IndicationStatus.FinishRegistration, "Finish Registration" },
|
{ IndicationStatus.FinishRegistration, Translations.Miscellaneous.IndicationFinishRegistration },
|
||||||
{ IndicationStatus.Started, "Waiting for code changes" },
|
{ IndicationStatus.Started, Translations.Miscellaneous.IndicationStarted },
|
||||||
{ IndicationStatus.Stopping, "Stopping Hot Reload" },
|
{ IndicationStatus.Stopping, Translations.Miscellaneous.IndicationStopping },
|
||||||
{ IndicationStatus.Stopped, "Hot Reload inactive" },
|
{ IndicationStatus.Stopped, Translations.Miscellaneous.IndicationStopped },
|
||||||
{ IndicationStatus.Installing, "Installing" },
|
{ IndicationStatus.Paused, Translations.Miscellaneous.IndicationPaused },
|
||||||
{ IndicationStatus.Starting, "Starting Hot Reload" },
|
{ IndicationStatus.Installing, Translations.Miscellaneous.IndicationInstalling },
|
||||||
{ IndicationStatus.Reloaded, "Reload finished" },
|
{ IndicationStatus.Starting, Translations.Miscellaneous.IndicationStarting },
|
||||||
{ IndicationStatus.PartiallySupported, "Changes partially applied" },
|
{ IndicationStatus.Reloaded, Translations.Miscellaneous.IndicationReloaded },
|
||||||
{ IndicationStatus.Unsupported, "Finished with warnings" },
|
{ IndicationStatus.PartiallySupported, Translations.Miscellaneous.IndicationPartiallySupported },
|
||||||
{ IndicationStatus.Patching, "Reloading" },
|
{ IndicationStatus.Unsupported, Translations.Miscellaneous.IndicationUnsupported },
|
||||||
{ IndicationStatus.Compiling, "Compiling" },
|
{ IndicationStatus.Patching, Translations.Miscellaneous.IndicationPatching },
|
||||||
{ IndicationStatus.CompileErrors, "Scripts have compile errors" },
|
{ IndicationStatus.Compiling, Translations.Miscellaneous.IndicationCompiling },
|
||||||
{ IndicationStatus.ActivationFailed, "Activation failed" },
|
{ IndicationStatus.CompileErrors, Translations.Miscellaneous.IndicationCompileErrors },
|
||||||
{ IndicationStatus.Loading, "Loading" },
|
{ IndicationStatus.ActivationFailed, Translations.Miscellaneous.IndicationActivationFailed },
|
||||||
{ IndicationStatus.Undetected, "No changes applied"},
|
{ IndicationStatus.Loading, Translations.Miscellaneous.IndicationLoading },
|
||||||
|
{ IndicationStatus.Undetected, Translations.Miscellaneous.IndicationUndetected},
|
||||||
};
|
};
|
||||||
|
|
||||||
private const int MinSpinnerDuration = 200;
|
private const int MinSpinnerDuration = 200;
|
||||||
@@ -127,6 +132,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
return IndicationStatus.Compiling;
|
return IndicationStatus.Compiling;
|
||||||
if (EditorCodePatcher.Starting && !EditorCodePatcher.Stopping)
|
if (EditorCodePatcher.Starting && !EditorCodePatcher.Stopping)
|
||||||
return IndicationStatus.Starting;
|
return IndicationStatus.Starting;
|
||||||
|
if (!Application.isPlaying && HotReloadPrefs.PauseHotReloadInEditMode)
|
||||||
|
return IndicationStatus.Paused;
|
||||||
if (!EditorCodePatcher.Running)
|
if (!EditorCodePatcher.Running)
|
||||||
return IndicationStatus.Stopped;
|
return IndicationStatus.Stopped;
|
||||||
if (EditorCodePatcher.Status?.isLicensed != true && EditorCodePatcher.Status?.isFree != true && EditorCodePatcher.Status?.freeSessionFinished == true)
|
if (EditorCodePatcher.Status?.isLicensed != true && EditorCodePatcher.Status?.isFree != true && EditorCodePatcher.Status?.freeSessionFinished == true)
|
||||||
@@ -172,7 +179,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (indicationStatus == IndicationStatus.Starting && EditorCodePatcher.StartupProgress != null) {
|
if (indicationStatus == IndicationStatus.Starting && EditorCodePatcher.StartupProgress != null) {
|
||||||
txt = EditorCodePatcher.StartupProgress.Item2;
|
txt = EditorCodePatcher.StartupProgress.Item2;
|
||||||
} else if (!IndicationText.TryGetValue(indicationStatus, out txt)) {
|
} else if (!IndicationText.TryGetValue(indicationStatus, out txt)) {
|
||||||
Log.Warning($"Indication text not found for status {indicationStatus}");
|
Log.Warning(Translations.Errors.WarningIndicationTextNotFound, indicationStatus);
|
||||||
} else {
|
} else {
|
||||||
txt = IndicationText[indicationStatus];
|
txt = IndicationText[indicationStatus];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.IO;
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
|
|
||||||
@@ -14,12 +15,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
internal static class AssemblyOmission {
|
internal static class AssemblyOmission {
|
||||||
// [MenuItem("Window/Hot Reload Dev/List omitted projects")]
|
// [MenuItem("Window/Hot Reload Dev/List omitted projects")]
|
||||||
private static void Check() {
|
private static void Check() {
|
||||||
Log.Info("To compile C# files same as a Player build, we must omit projects which aren't part of the selected Player build.");
|
Log.Info(Translations.Errors.InfoOmitProjectsForPlayerBuild);
|
||||||
var omitted = GetOmittedProjects(EditorUserBuildSettings.activeScriptCompilationDefines);
|
var omitted = GetOmittedProjects(EditorUserBuildSettings.activeScriptCompilationDefines);
|
||||||
Log.Info("---------");
|
Log.Info(Translations.Errors.InfoSeparator);
|
||||||
|
|
||||||
foreach (var name in omitted) {
|
foreach (var name in omitted) {
|
||||||
Log.Info("omitted editor/other project named: {0}", name);
|
Log.Info(Translations.Errors.InfoOmittedEditorProject, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,10 +70,10 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
if (verboseLogs) {
|
if (verboseLogs) {
|
||||||
foreach (var name in editorAssemblies) {
|
foreach (var name in editorAssemblies) {
|
||||||
Log.Info("found project named {0}", name);
|
Log.Info(Translations.Errors.InfoFoundProjectNamed, name);
|
||||||
}
|
}
|
||||||
foreach (var playerAssemblyName in playerAssemblies) {
|
foreach (var playerAssemblyName in playerAssemblies) {
|
||||||
Log.Debug("player assembly named {0}", playerAssemblyName);
|
Log.Debug(string.Format(Translations.Utility.PlayerAssemblyDebug, playerAssemblyName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// leaves the editor assemblies that are not built into player assemblies (e.g. editor and test assemblies)
|
// leaves the editor assemblies that are not built into player assemblies (e.g. editor and test assemblies)
|
||||||
|
|||||||
@@ -12,12 +12,14 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
public readonly BuildTarget activeBuildTarget;
|
public readonly BuildTarget activeBuildTarget;
|
||||||
public readonly string[] omittedProjects;
|
public readonly string[] omittedProjects;
|
||||||
public readonly bool batchMode;
|
public readonly bool batchMode;
|
||||||
|
public readonly string locale;
|
||||||
|
|
||||||
public BuildInfoInput(string allDefineSymbols, BuildTarget activeBuildTarget, string[] omittedProjects, bool batchMode) {
|
public BuildInfoInput(string allDefineSymbols, BuildTarget activeBuildTarget, string[] omittedProjects, bool batchMode, string locale) {
|
||||||
this.allDefineSymbols = allDefineSymbols;
|
this.allDefineSymbols = allDefineSymbols;
|
||||||
this.activeBuildTarget = activeBuildTarget;
|
this.activeBuildTarget = activeBuildTarget;
|
||||||
this.omittedProjects = omittedProjects;
|
this.omittedProjects = omittedProjects;
|
||||||
this.batchMode = batchMode;
|
this.batchMode = batchMode;
|
||||||
|
this.locale = locale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,12 +33,14 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
});
|
});
|
||||||
// cached so unexpensive most of the time
|
// cached so unexpensive most of the time
|
||||||
var omittedProjects = AssemblyOmission.GetOmittedProjects(allDefineSymbols);
|
var omittedProjects = AssemblyOmission.GetOmittedProjects(allDefineSymbols);
|
||||||
|
var locale = PackageConst.DefaultLocale;
|
||||||
|
|
||||||
return new BuildInfoInput(
|
return new BuildInfoInput(
|
||||||
allDefineSymbols: allDefineSymbols,
|
allDefineSymbols: allDefineSymbols,
|
||||||
activeBuildTarget: buildTarget,
|
activeBuildTarget: buildTarget,
|
||||||
omittedProjects: omittedProjects,
|
omittedProjects: omittedProjects,
|
||||||
batchMode: batchMode
|
batchMode: batchMode,
|
||||||
|
locale: locale
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +54,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
allDefineSymbols: allDefineSymbols,
|
allDefineSymbols: allDefineSymbols,
|
||||||
activeBuildTarget: buildTarget,
|
activeBuildTarget: buildTarget,
|
||||||
omittedProjects: AssemblyOmission.GetOmittedProjects(allDefineSymbols),
|
omittedProjects: AssemblyOmission.GetOmittedProjects(allDefineSymbols),
|
||||||
batchMode: Application.isBatchMode
|
batchMode: Application.isBatchMode,
|
||||||
|
locale: PackageConst.DefaultLocale
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +77,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
buildMachinePort = RequestHelper.port,
|
buildMachinePort = RequestHelper.port,
|
||||||
activeBuildTarget = input.activeBuildTarget.ToString(),
|
activeBuildTarget = input.activeBuildTarget.ToString(),
|
||||||
buildMachineRequestOrigin = RequestHelper.origin,
|
buildMachineRequestOrigin = RequestHelper.origin,
|
||||||
|
locale = input.locale
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal static class EditorWindowHelper {
|
internal static class EditorWindowHelper {
|
||||||
@@ -37,9 +38,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
NeedsRecompile
|
NeedsRecompile
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly Dictionary<NotificationStatus, GUIContent> notificationContent = new Dictionary<NotificationStatus, GUIContent> {
|
private static Dictionary<NotificationStatus, GUIContent> notificationContent => new Dictionary<NotificationStatus, GUIContent> {
|
||||||
{ NotificationStatus.Patching, new GUIContent("[Hot Reload] Applying patches...")},
|
{ NotificationStatus.Patching, new GUIContent(Translations.Miscellaneous.NotificationPatching)},
|
||||||
{ NotificationStatus.NeedsRecompile, new GUIContent("[Hot Reload] Unsupported Changes detected! Recompiling...")},
|
{ NotificationStatus.NeedsRecompile, new GUIContent(Translations.Miscellaneous.NotificationNeedsRecompile)},
|
||||||
};
|
};
|
||||||
|
|
||||||
static Type gameViewT;
|
static Type gameViewT;
|
||||||
|
|||||||
@@ -4,11 +4,14 @@ using System.Diagnostics;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SingularityGroup.HotReload.DTO;
|
using SingularityGroup.HotReload.DTO;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
using UnityEditor.PackageManager;
|
using UnityEditor.PackageManager;
|
||||||
using UnityEditor.PackageManager.Requests;
|
using UnityEditor.PackageManager.Requests;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Translations = SingularityGroup.HotReload.Editor.Localization.Translations;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
|
|
||||||
@@ -111,19 +114,19 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static readonly OpenURLButton recompileTroubleshootingButton = new OpenURLButton("Docs", Constants.RecompileTroubleshootingURL);
|
internal static readonly OpenURLButton recompileTroubleshootingButton = new OpenURLButton(Translations.Suggestions.ButtonDocs, Constants.RecompileTroubleshootingURL);
|
||||||
internal static readonly OpenURLButton featuresDocumentationButton = new OpenURLButton("Docs", Constants.FeaturesDocumentationURL);
|
internal static readonly OpenURLButton featuresDocumentationButton = new OpenURLButton(Translations.Suggestions.ButtonDocs, Constants.FeaturesDocumentationURL);
|
||||||
internal static readonly OpenURLButton multipleEditorsDocumentationButton = new OpenURLButton("Docs", Constants.MultipleEditorsURL);
|
internal static readonly OpenURLButton multipleEditorsDocumentationButton = new OpenURLButton(Translations.Suggestions.ButtonDocs, Constants.MultipleEditorsURL);
|
||||||
internal static readonly OpenURLButton debuggerDocumentationButton = new OpenURLButton("More Info", Constants.DebuggerURL);
|
internal static readonly OpenURLButton debuggerDocumentationButton = new OpenURLButton(Translations.Suggestions.ButtonMoreInfo, Constants.DebuggerURL);
|
||||||
public static Dictionary<HotReloadSuggestionKind, AlertEntry> suggestionMap = new Dictionary<HotReloadSuggestionKind, AlertEntry> {
|
public static Dictionary<HotReloadSuggestionKind, AlertEntry> suggestionMap = new Dictionary<HotReloadSuggestionKind, AlertEntry> {
|
||||||
{ HotReloadSuggestionKind.UnityBestDevelopmentToolAward2023, new AlertEntry(
|
{ HotReloadSuggestionKind.UnityBestDevelopmentToolAward2023, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Vote for the \"Best Development Tool\" Award!",
|
Translations.Suggestions.Award2023Title,
|
||||||
"Hot Reload was nominated for the \"Best Development Tool\" Award. Please consider voting. Thank you!",
|
Translations.Suggestions.Award2023Message,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(6f);
|
GUILayout.Space(6f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" Vote ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonVote)) {
|
||||||
Application.OpenURL(Constants.VoteForAwardURL);
|
Application.OpenURL(Constants.VoteForAwardURL);
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.UnityBestDevelopmentToolAward2023);
|
SetSuggestionInactive(HotReloadSuggestionKind.UnityBestDevelopmentToolAward2023);
|
||||||
}
|
}
|
||||||
@@ -135,8 +138,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
)},
|
)},
|
||||||
{ HotReloadSuggestionKind.UnsupportedChanges, new AlertEntry(
|
{ HotReloadSuggestionKind.UnsupportedChanges, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Which changes does Hot Reload support?",
|
Translations.Suggestions.UnsupportedChangesTitle,
|
||||||
"Hot Reload supports most code changes, but there are some limitations. Generally, changes to methods and fields are supported. Things like adding new types is not (yet) supported. See the documentation for the list of current features and our current roadmap",
|
Translations.Suggestions.UnsupportedChangesMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
@@ -149,8 +152,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
)},
|
)},
|
||||||
{ HotReloadSuggestionKind.UnsupportedPackages, new AlertEntry(
|
{ HotReloadSuggestionKind.UnsupportedPackages, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Unsupported package detected",
|
Translations.Suggestions.UnsupportedPackagesTitle,
|
||||||
"The following packages are only partially supported: ECS, Mirror, Fishnet, and Photon. Hot Reload will work in the project, but changes specific to those packages might not hot-reload",
|
Translations.Suggestions.UnsupportedPackagesMessage,
|
||||||
iconType: AlertType.UnsupportedChange,
|
iconType: AlertType.UnsupportedChange,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
@@ -164,8 +167,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
)},
|
)},
|
||||||
{ HotReloadSuggestionKind.AutoRecompiledWhenPlaymodeStateChanges, new AlertEntry(
|
{ HotReloadSuggestionKind.AutoRecompiledWhenPlaymodeStateChanges, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Unity recompiles on enter/exit play mode?",
|
Translations.Suggestions.AutoRecompiledPlaymodeTitle,
|
||||||
"If you have an issue with the Unity Editor recompiling when the Play Mode state changes, more info is available in the docs. Feel free to reach out if you require assistance. We'll be glad to help.",
|
Translations.Suggestions.AutoRecompiledPlaymodeMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
@@ -183,23 +186,23 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
#if UNITY_2022_1_OR_NEWER
|
#if UNITY_2022_1_OR_NEWER
|
||||||
{ HotReloadSuggestionKind.AutoRecompiledWhenPlaymodeStateChanges2022, new AlertEntry(
|
{ HotReloadSuggestionKind.AutoRecompiledWhenPlaymodeStateChanges2022, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Unsupported setting detected",
|
Translations.Suggestions.AutoRecompiled2022Title,
|
||||||
"The 'Sprite Packer Mode' setting can cause unintended recompilations if set to 'Sprite Atlas V1 - Always Enabled'",
|
Translations.Suggestions.AutoRecompiled2022Message,
|
||||||
iconType: AlertType.UnsupportedChange,
|
iconType: AlertType.UnsupportedChange,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" Use \"Build Time Only Atlas\" ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonUseBuildTimeOnlyAtlas)) {
|
||||||
if (EditorSettings.spritePackerMode == SpritePackerMode.SpriteAtlasV2) {
|
if (EditorSettings.spritePackerMode == SpritePackerMode.SpriteAtlasV2) {
|
||||||
EditorSettings.spritePackerMode = SpritePackerMode.SpriteAtlasV2Build;
|
EditorSettings.spritePackerMode = SpritePackerMode.SpriteAtlasV2Build;
|
||||||
} else {
|
} else {
|
||||||
EditorSettings.spritePackerMode = SpritePackerMode.BuildTimeOnlyAtlas;
|
EditorSettings.spritePackerMode = SpritePackerMode.BuildTimeOnlyAtlas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(" Open Settings ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonOpenSettings)) {
|
||||||
SettingsService.OpenProjectSettings("Project/Editor");
|
SettingsService.OpenProjectSettings("Project/Editor");
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(" Ignore suggestion ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonIgnoreSuggestion)) {
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.AutoRecompiledWhenPlaymodeStateChanges2022);
|
SetSuggestionInactive(HotReloadSuggestionKind.AutoRecompiledWhenPlaymodeStateChanges2022);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,14 +216,20 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
#endif
|
#endif
|
||||||
{ HotReloadSuggestionKind.MultidimensionalArrays, new AlertEntry(
|
{ HotReloadSuggestionKind.MultidimensionalArrays, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Use jagged instead of multidimensional arrays",
|
Translations.Suggestions.MultidimensionalArraysTitle,
|
||||||
"Hot Reload doesn't support methods with multidimensional arrays ([,]). You can work around this by using jagged arrays ([][])",
|
Translations.Suggestions.MultidimensionalArraysMessage,
|
||||||
iconType: AlertType.UnsupportedChange,
|
iconType: AlertType.UnsupportedChange,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" Learn more ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonLearnMore)) {
|
||||||
Application.OpenURL("https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1814");
|
string url;
|
||||||
|
if (PackageConst.DefaultLocaleField == Locale.SimplifiedChinese) {
|
||||||
|
url = "https://learn.microsoft.com/zh-cn/dotnet/fundamentals/code-analysis/quality-rules/ca1814";
|
||||||
|
} else {
|
||||||
|
url = "https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1814";
|
||||||
|
}
|
||||||
|
Application.OpenURL(url);
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
}
|
}
|
||||||
@@ -230,12 +239,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
)},
|
)},
|
||||||
{ HotReloadSuggestionKind.EditorsWithoutHRRunning, new AlertEntry(
|
{ HotReloadSuggestionKind.EditorsWithoutHRRunning, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Some Unity instances don't have Hot Reload running.",
|
Translations.Suggestions.EditorsWithoutHRTitle,
|
||||||
"Make sure that either: \n1) Hot Reload is installed and running on all Editor instances, or \n2) Hot Reload is stopped in all Editor instances where it is installed.",
|
Translations.Suggestions.EditorsWithoutHRMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" Stop Hot Reload ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonStopHotReload)) {
|
||||||
EditorCodePatcher.StopCodePatcher().Forget();
|
EditorCodePatcher.StopCodePatcher().Forget();
|
||||||
}
|
}
|
||||||
GUILayout.Space(5f);
|
GUILayout.Space(5f);
|
||||||
@@ -243,7 +252,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
multipleEditorsDocumentationButton.OnGUI();
|
multipleEditorsDocumentationButton.OnGUI();
|
||||||
GUILayout.Space(5f);
|
GUILayout.Space(5f);
|
||||||
|
|
||||||
if (GUILayout.Button(" Don't show again ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonDontShowAgain)) {
|
||||||
HotReloadSuggestionsHelper.SetSuggestionsShown(HotReloadSuggestionKind.EditorsWithoutHRRunning);
|
HotReloadSuggestionsHelper.SetSuggestionsShown(HotReloadSuggestionKind.EditorsWithoutHRRunning);
|
||||||
HotReloadSuggestionsHelper.SetSuggestionInactive(HotReloadSuggestionKind.EditorsWithoutHRRunning);
|
HotReloadSuggestionsHelper.SetSuggestionInactive(HotReloadSuggestionKind.EditorsWithoutHRRunning);
|
||||||
}
|
}
|
||||||
@@ -258,16 +267,16 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
// Not in use (never reported from the server)
|
// Not in use (never reported from the server)
|
||||||
{ HotReloadSuggestionKind.FieldInitializerWithSideEffects, new AlertEntry(
|
{ HotReloadSuggestionKind.FieldInitializerWithSideEffects, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Field initializer with side-effects detected",
|
Translations.Suggestions.FieldInitializerSideEffectsTitle,
|
||||||
"A field initializer update might have side effects, e.g. calling a method or creating an object.\n\nWhile Hot Reload does support this, it can sometimes be confusing when the initializer logic runs at 'unexpected times'.",
|
Translations.Suggestions.FieldInitializerSideEffectsMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" OK ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonOK)) {
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerWithSideEffects);
|
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerWithSideEffects);
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (GUILayout.Button(" Don't show again ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonDontShowAgain)) {
|
||||||
SetSuggestionsShown(HotReloadSuggestionKind.FieldInitializerWithSideEffects);
|
SetSuggestionsShown(HotReloadSuggestionKind.FieldInitializerWithSideEffects);
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerWithSideEffects);
|
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerWithSideEffects);
|
||||||
}
|
}
|
||||||
@@ -279,17 +288,17 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
)},
|
)},
|
||||||
{ HotReloadSuggestionKind.DetailedErrorReportingIsEnabled, new AlertEntry(
|
{ HotReloadSuggestionKind.DetailedErrorReportingIsEnabled, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Detailed error reporting is enabled",
|
Translations.Suggestions.DetailedErrorReportingTitle,
|
||||||
"When an error happens in Hot Reload, the exception stacktrace is sent as telemetry to help diagnose and fix the issue.\nThe exception stack trace is only included if it originated from the Hot Reload package or binary. Stacktraces from your own code are not sent.\nYou can disable detailed error reporting to prevent telemetry from including any information about your project.",
|
Translations.Suggestions.DetailedErrorReportingMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
GUILayout.Space(4f);
|
GUILayout.Space(4f);
|
||||||
if (GUILayout.Button(" OK ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonOKPadded)) {
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.DetailedErrorReportingIsEnabled);
|
SetSuggestionInactive(HotReloadSuggestionKind.DetailedErrorReportingIsEnabled);
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (GUILayout.Button(" Disable ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonDisable)) {
|
||||||
HotReloadSettingsTab.DisableDetailedErrorReportingInner(true);
|
HotReloadSettingsTab.DisableDetailedErrorReportingInner(true);
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.DetailedErrorReportingIsEnabled);
|
SetSuggestionInactive(HotReloadSuggestionKind.DetailedErrorReportingIsEnabled);
|
||||||
}
|
}
|
||||||
@@ -303,22 +312,22 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
// Not in use (never reported from the server)
|
// Not in use (never reported from the server)
|
||||||
{ HotReloadSuggestionKind.FieldInitializerExistingInstancesEdited, new AlertEntry(
|
{ HotReloadSuggestionKind.FieldInitializerExistingInstancesEdited, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Field initializer edit updated the value of existing class instances",
|
Translations.Suggestions.FieldInitializerEditedTitle,
|
||||||
"By default, Hot Reload updates field values of existing object instances when new field initializer has constant value.\n\nIf you want to change this behavior, disable the \"Apply field initializer edits to existing class instances\" option in Settings or click the button below.",
|
Translations.Suggestions.FieldInitializerEditedMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" Turn off ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonTurnOff)) {
|
||||||
#pragma warning disable CS0618
|
#pragma warning disable CS0618
|
||||||
HotReloadSettingsTab.ApplyApplyFieldInitializerEditsToExistingClassInstances(false);
|
HotReloadSettingsTab.ApplyApplyFieldInitializerEditsToExistingClassInstances(false);
|
||||||
#pragma warning restore CS0618
|
#pragma warning restore CS0618
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerExistingInstancesEdited);
|
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerExistingInstancesEdited);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(" Open Settings ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonOpenSettings)) {
|
||||||
HotReloadWindow.Current.SelectTab(typeof(HotReloadSettingsTab));
|
HotReloadWindow.Current.SelectTab(typeof(HotReloadSettingsTab));
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (GUILayout.Button(" Don't show again ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonDontShowAgain)) {
|
||||||
SetSuggestionsShown(HotReloadSuggestionKind.FieldInitializerExistingInstancesEdited);
|
SetSuggestionsShown(HotReloadSuggestionKind.FieldInitializerExistingInstancesEdited);
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerExistingInstancesEdited);
|
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerExistingInstancesEdited);
|
||||||
}
|
}
|
||||||
@@ -330,12 +339,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
)},
|
)},
|
||||||
{ HotReloadSuggestionKind.FieldInitializerExistingInstancesUnedited, new AlertEntry(
|
{ HotReloadSuggestionKind.FieldInitializerExistingInstancesUnedited, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Field initializer edits don't apply to existing objects",
|
Translations.Suggestions.FieldInitializerUneditedTitle,
|
||||||
"By default, Hot Reload applies field initializer edits of existing fields only to new objects (newly instantiated classes), just like normal C#.\n\nFor rapid prototyping, you can use static fields which will update across all instances.",
|
Translations.Suggestions.FieldInitializerUneditedMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(8f);
|
GUILayout.Space(8f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" OK ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonOK)) {
|
||||||
SetSuggestionsShown(HotReloadSuggestionKind.FieldInitializerExistingInstancesUnedited);
|
SetSuggestionsShown(HotReloadSuggestionKind.FieldInitializerExistingInstancesUnedited);
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerExistingInstancesUnedited);
|
SetSuggestionInactive(HotReloadSuggestionKind.FieldInitializerExistingInstancesUnedited);
|
||||||
}
|
}
|
||||||
@@ -348,22 +357,22 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
)},
|
)},
|
||||||
{ HotReloadSuggestionKind.AddMonobehaviourMethod, new AlertEntry(
|
{ HotReloadSuggestionKind.AddMonobehaviourMethod, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"New MonoBehaviour methods are not shown in the inspector",
|
Translations.Suggestions.AddMonobehaviourMethodTitle,
|
||||||
"New methods in MonoBehaviours are not shown in the inspector until the script is recompiled. This is a limitation of Hot Reload handling of Unity's serialization system.\n\nYou can use the button below to auto recompile partially supported changes such as this one.",
|
Translations.Suggestions.AddMonobehaviourMethodMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(8f);
|
GUILayout.Space(8f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" OK ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonOK)) {
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.AddMonobehaviourMethod);
|
SetSuggestionInactive(HotReloadSuggestionKind.AddMonobehaviourMethod);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(" Auto Recompile ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonAutoRecompile)) {
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.AddMonobehaviourMethod);
|
SetSuggestionInactive(HotReloadSuggestionKind.AddMonobehaviourMethod);
|
||||||
HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges = true;
|
HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges = true;
|
||||||
HotReloadPrefs.DisplayNewMonobehaviourMethodsAsPartiallySupported = true;
|
HotReloadPrefs.DisplayNewMonobehaviourMethodsAsPartiallySupported = true;
|
||||||
HotReloadRunTab.RecompileWithChecks();
|
HotReloadRunTab.RecompileWithChecks();
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (GUILayout.Button(" Don't show again ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonDontShowAgain)) {
|
||||||
SetSuggestionsShown(HotReloadSuggestionKind.AddMonobehaviourMethod);
|
SetSuggestionsShown(HotReloadSuggestionKind.AddMonobehaviourMethod);
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.AddMonobehaviourMethod);
|
SetSuggestionInactive(HotReloadSuggestionKind.AddMonobehaviourMethod);
|
||||||
}
|
}
|
||||||
@@ -376,12 +385,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
#if UNITY_2020_1_OR_NEWER
|
#if UNITY_2020_1_OR_NEWER
|
||||||
{ HotReloadSuggestionKind.SwitchToDebugModeForInlinedMethods, new AlertEntry(
|
{ HotReloadSuggestionKind.SwitchToDebugModeForInlinedMethods, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Switch code optimization to Debug Mode",
|
Translations.Suggestions.SwitchToDebugModeTitle,
|
||||||
"In Release Mode some methods are inlined, which prevents Hot Reload from applying changes. A clear warning is always shown when this happens, but you can use Debug Mode to avoid the issue altogether",
|
Translations.Suggestions.SwitchToDebugModeMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" Switch to Debug mode ") && HotReloadRunTab.ConfirmExitPlaymode("Switching code optimization will stop Play Mode.\n\nDo you wish to proceed?")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonSwitchToDebugMode) && HotReloadRunTab.ConfirmExitPlaymode(Translations.Suggestions.SwitchToDebugModeConfirmation)) {
|
||||||
HotReloadRunTab.SwitchToDebugMode();
|
HotReloadRunTab.SwitchToDebugMode();
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
@@ -394,18 +403,18 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
#endif
|
#endif
|
||||||
{ HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached, new AlertEntry(
|
{ HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Hot Reload is disabled while a debugger is attached",
|
Translations.Suggestions.DebuggerAttachedTitle,
|
||||||
"Hot Reload automatically disables itself while a debugger is attached, as it can otherwise interfere with certain debugger features.\nWhile disabled, every code change will trigger a full Unity recompilation.\n\nYou can choose to keep Hot Reload enabled while a debugger is attached, though some features like debugger variable inspection might not always work as expected.",
|
Translations.Suggestions.DebuggerAttachedMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(8f);
|
GUILayout.Space(8f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" Keep enabled during debugging ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonKeepEnabledDuringDebugging)) {
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached);
|
SetSuggestionInactive(HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached);
|
||||||
HotReloadPrefs.AutoDisableHotReloadWithDebugger = false;
|
HotReloadPrefs.AutoDisableHotReloadWithDebugger = false;
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
debuggerDocumentationButton.OnGUI();
|
debuggerDocumentationButton.OnGUI();
|
||||||
if (GUILayout.Button(" Don't show again ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonDontShowAgain)) {
|
||||||
SetSuggestionsShown(HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached);
|
SetSuggestionsShown(HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached);
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached);
|
SetSuggestionInactive(HotReloadSuggestionKind.HotReloadWhileDebuggerIsAttached);
|
||||||
}
|
}
|
||||||
@@ -417,14 +426,14 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
)},
|
)},
|
||||||
{ HotReloadSuggestionKind.HotReloadedMethodsWhenDebuggerIsAttached, new AlertEntry(
|
{ HotReloadSuggestionKind.HotReloadedMethodsWhenDebuggerIsAttached, new AlertEntry(
|
||||||
AlertType.Suggestion,
|
AlertType.Suggestion,
|
||||||
"Hot Reload may interfere with your debugger session",
|
Translations.Suggestions.DebuggerMethodsTitle,
|
||||||
"Some debugger features, like variable inspection, might not work as expected for methods patched during the Hot Reload session. A full Unity recompile is required to get the full debugger experience.",
|
Translations.Suggestions.DebuggerMethodsMessage,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(8f);
|
GUILayout.Space(8f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button(" Recompile ")) {
|
if (GUILayout.Button(Translations.Suggestions.ButtonRecompile)) {
|
||||||
SetSuggestionInactive(HotReloadSuggestionKind.HotReloadedMethodsWhenDebuggerIsAttached);
|
SetSuggestionInactive(HotReloadSuggestionKind.HotReloadedMethodsWhenDebuggerIsAttached);
|
||||||
if (HotReloadRunTab.ConfirmExitPlaymode("Using the Recompile button will stop Play Mode.\n\nDo you wish to proceed?")) {
|
if (HotReloadRunTab.ConfirmExitPlaymode(Translations.Suggestions.DebuggerMethodsConfirmation)) {
|
||||||
HotReloadRunTab.Recompile();
|
HotReloadRunTab.Recompile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -516,17 +525,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
private static async Task CheckEditorsWithoutHRAsync() {
|
private static async Task CheckEditorsWithoutHRAsync() {
|
||||||
try {
|
try {
|
||||||
checkingEditorsWihtoutHR = true;
|
checkingEditorsWihtoutHR = true;
|
||||||
var showSuggestion = await Task.Run(() => {
|
var editorsWithoutHr = await RequestHelper.RequestEditorsWithoutHRRunning();
|
||||||
try {
|
if (editorsWithoutHr == null) {
|
||||||
var runningUnities = Process.GetProcessesByName("Unity Editor").Length;
|
return;
|
||||||
var runningPatchers = Process.GetProcessesByName("CodePatcherCLI").Length;
|
}
|
||||||
return runningPatchers > 0 && runningUnities > runningPatchers;
|
var showSuggestion = editorsWithoutHr.editorsWithoutHRRunning;
|
||||||
} catch (ArgumentException) {
|
|
||||||
// On some devices GetProcessesByName throws ArgumentException for no good reason.
|
|
||||||
// it happens rarely and the feature is not the most important so proper solution is not required
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!showSuggestion) {
|
if (!showSuggestion) {
|
||||||
HotReloadSuggestionsHelper.SetSuggestionInactive(HotReloadSuggestionKind.EditorsWithoutHRRunning);
|
HotReloadSuggestionsHelper.SetSuggestionInactive(HotReloadSuggestionKind.EditorsWithoutHRRunning);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ using System.Linq;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using SingularityGroup.HotReload.DTO;
|
using SingularityGroup.HotReload.DTO;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Translations = SingularityGroup.HotReload.Editor.Localization.Translations;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal enum TimelineType {
|
internal enum TimelineType {
|
||||||
@@ -152,7 +153,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.Warning($"Failed initializing Hot Reload event entries on start: {e}");
|
Log.Warning(Translations.Errors.WarningInitializingEventEntries, e);
|
||||||
} finally {
|
} finally {
|
||||||
// Ensure red dot is not triggered for existing entries
|
// Ensure red dot is not triggered for existing entries
|
||||||
HotReloadState.ShowingRedDot = redDotShown;
|
HotReloadState.ShowingRedDot = redDotShown;
|
||||||
@@ -168,7 +169,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
try {
|
try {
|
||||||
File.WriteAllText(path: filePath, contents: JsonConvert.SerializeObject(persistedData));
|
File.WriteAllText(path: filePath, contents: JsonConvert.SerializeObject(persistedData));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.Warning($"Failed persisting Hot Reload event entries: {e}");
|
Log.Warning(Translations.Errors.WarningPersistingEventEntries, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,20 +192,20 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#pragma warning disable CS0612 // obsolete
|
#pragma warning disable CS0612 // obsolete
|
||||||
public static Dictionary<PartiallySupportedChange, string> partiallySupportedChangeDescriptions = new Dictionary<PartiallySupportedChange, string> {
|
public static Dictionary<PartiallySupportedChange, string> partiallySupportedChangeDescriptions => new Dictionary<PartiallySupportedChange, string> {
|
||||||
{PartiallySupportedChange.LambdaClosure, "A lambda closure was edited (captured variable was added or removed). Changes to it will only be visible to the next created lambda(s)."},
|
{PartiallySupportedChange.LambdaClosure, Translations.Timeline.PartiallySupportedLambdaClosure},
|
||||||
{PartiallySupportedChange.EditAsyncMethod, "An async method was edited. Changes to it will only be visible the next time this method is called."},
|
{PartiallySupportedChange.EditAsyncMethod, Translations.Timeline.PartiallySupportedEditAsyncMethod},
|
||||||
{PartiallySupportedChange.AddMonobehaviourMethod, "A new method was added. It will not show up in the Inspector until the next full recompilation."},
|
{PartiallySupportedChange.AddMonobehaviourMethod, Translations.Timeline.PartiallySupportedAddMonobehaviourMethod},
|
||||||
{PartiallySupportedChange.EditMonobehaviourField, "A field in a MonoBehaviour was removed or reordered. The inspector will not notice this change until the next full recompilation."},
|
{PartiallySupportedChange.EditMonobehaviourField, Translations.Timeline.PartiallySupportedEditMonobehaviourField},
|
||||||
{PartiallySupportedChange.EditCoroutine, "An IEnumerator/IEnumerable was edited. When used as a coroutine, changes to it will only be visible the next time the coroutine is created."},
|
{PartiallySupportedChange.EditCoroutine, Translations.Timeline.PartiallySupportedEditCoroutine},
|
||||||
{PartiallySupportedChange.EditGenericFieldInitializer, "A field initializer inside generic class was edited. Field initializer will not have any effect until the next full recompilation."},
|
{PartiallySupportedChange.EditGenericFieldInitializer, Translations.Timeline.PartiallySupportedEditGenericFieldInitializer},
|
||||||
{PartiallySupportedChange.AddEnumMember, "An enum member was added. ToString and other reflection methods work only after the next full recompilation. Additionally, changes to the enum order may not apply until you patch usages in other places of the code."},
|
{PartiallySupportedChange.AddEnumMember, Translations.Timeline.PartiallySupportedAddEnumMember},
|
||||||
{PartiallySupportedChange.EditFieldInitializer, "A field initializer was edited. Changes will only apply to new instances of that type, since the initializer for an object only runs when it is created."},
|
{PartiallySupportedChange.EditFieldInitializer, Translations.Timeline.PartiallySupportedEditFieldInitializer},
|
||||||
{PartiallySupportedChange.AddMethodWithAttributes, "A method with attributes was added. Method attributes will not have any effect until the next full recompilation."},
|
{PartiallySupportedChange.AddMethodWithAttributes, Translations.Timeline.PartiallySupportedAddMethodWithAttributes},
|
||||||
{PartiallySupportedChange.AddFieldWithAttributes, "A field with attributes was added. Field attributes will not have any effect until the next full recompilation."},
|
{PartiallySupportedChange.AddFieldWithAttributes, Translations.Timeline.PartiallySupportedAddFieldWithAttributes},
|
||||||
{PartiallySupportedChange.GenericMethodInGenericClass, "A generic method was edited. Usages in non-generic classes applied, but usages in the generic classes are not supported."},
|
{PartiallySupportedChange.GenericMethodInGenericClass, Translations.Timeline.PartiallySupportedGenericMethodInGenericClass},
|
||||||
{PartiallySupportedChange.NewCustomSerializableField, "A new custom serializable field was added. The inspector will not notice this change until the next full recompilation."},
|
{PartiallySupportedChange.NewCustomSerializableField, Translations.Timeline.PartiallySupportedNewCustomSerializableField},
|
||||||
{PartiallySupportedChange.MultipleFieldsEditedInTheSameType, "Multiple fields modified in the same type during a single patch. Their values have been reset."},
|
{PartiallySupportedChange.MultipleFieldsEditedInTheSameType, Translations.Timeline.PartiallySupportedMultipleFieldsEditedInTheSameType},
|
||||||
};
|
};
|
||||||
#pragma warning restore CS0612
|
#pragma warning restore CS0612
|
||||||
|
|
||||||
@@ -215,7 +216,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
internal static int CompileErrorsCount => EventsTimeline.Count(alert => alert.alertType == AlertType.CompileError);
|
internal static int CompileErrorsCount => EventsTimeline.Count(alert => alert.alertType == AlertType.CompileError);
|
||||||
internal static int AppliedChangesCount => EventsTimeline.Count(alert => alert.alertType == AlertType.AppliedChange);
|
internal static int AppliedChangesCount => EventsTimeline.Count(alert => alert.alertType == AlertType.AppliedChange);
|
||||||
|
|
||||||
static Regex shortDescriptionRegex = new Regex(@"^(\w+)\s(\w+)(?=:)", RegexOptions.Compiled);
|
static Regex shortDescriptionRegex = new Regex(PackageConst.DefaultLocale == Locale.SimplifiedChinese ? @"^([\p{L}\p{N}_]+)\s([\p{L}\p{N}_]+)(?=:)" : @"^(\w+)\s(\w+)(?=:)", RegexOptions.Compiled);
|
||||||
|
|
||||||
internal static int GetRunTabTimelineEventCount() {
|
internal static int GetRunTabTimelineEventCount() {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
@@ -240,7 +241,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
internal static List<AlertEntry> expandedEntries = new List<AlertEntry>();
|
internal static List<AlertEntry> expandedEntries = new List<AlertEntry>();
|
||||||
|
|
||||||
internal static void RenderCompileButton() {
|
internal static void RenderCompileButton() {
|
||||||
if (GUILayout.Button("Recompile", GUILayout.Width(80))) {
|
if (GUILayout.Button(Translations.Common.ButtonRecompile.Trim(), GUILayout.Width(80))) {
|
||||||
HotReloadRunTab.RecompileWithChecks();
|
HotReloadRunTab.RecompileWithChecks();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -330,8 +331,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
? AlertType.CompileError
|
? AlertType.CompileError
|
||||||
: AlertType.UnsupportedChange;
|
: AlertType.UnsupportedChange;
|
||||||
var title = errorString.Contains("error CS")
|
var title = errorString.Contains("error CS")
|
||||||
? "Compile error"
|
? Translations.Utility.CompileError
|
||||||
: "Unsupported change";
|
: Translations.Utility.UnsupportedChange;
|
||||||
ErrorData errorData = ErrorData.GetErrorData(errorString);
|
ErrorData errorData = ErrorData.GetErrorData(errorString);
|
||||||
var description = errorData.error;
|
var description = errorData.error;
|
||||||
string shortDescription = null;
|
string shortDescription = null;
|
||||||
@@ -363,8 +364,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
var entry = new AlertEntry(
|
var entry = new AlertEntry(
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
alertType : AlertType.UnsupportedChange,
|
alertType : AlertType.UnsupportedChange,
|
||||||
title: "Failed applying patch to method",
|
title: Translations.Timeline.EventTitleFailedApplyingPatch,
|
||||||
description: $"Some methods got inlined by the Unity compiler and cannot be patched by Hot Reload. Switch to Debug mode to avoid this problem.\n\n• {(truncated ? patchesList + "\n..." : patchesList)}",
|
description: $"{Translations.Timeline.EventDescriptionInlinedMethods}\n\n• {(truncated ? patchesList + "\n..." : patchesList)}",
|
||||||
entryType: EntryType.Parent,
|
entryType: EntryType.Parent,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
@@ -388,13 +389,13 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
internal static void CreatePatchFailureEventEntry(string errorString, string methodName, string methodSimpleName = null, EntryType entryType = EntryType.Standalone, DateTime? createdAt = null) {
|
internal static void CreatePatchFailureEventEntry(string errorString, string methodName, string methodSimpleName = null, EntryType entryType = EntryType.Standalone, DateTime? createdAt = null) {
|
||||||
var timestamp = createdAt ?? DateTime.Now;
|
var timestamp = createdAt ?? DateTime.Now;
|
||||||
ErrorData errorData = ErrorData.GetErrorData(errorString);
|
ErrorData errorData = ErrorData.GetErrorData(errorString);
|
||||||
var title = $"Failed applying patch to method";
|
var title = Translations.Timeline.EventTitleFailedApplyingPatch;
|
||||||
Action actionData = () => RenderErrorEventActions(errorData.error, errorData);
|
Action actionData = () => RenderErrorEventActions(errorData.error, errorData);
|
||||||
InsertEntry(new AlertEntry(
|
InsertEntry(new AlertEntry(
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
alertType : AlertType.UnsupportedChange,
|
alertType : AlertType.UnsupportedChange,
|
||||||
title: title,
|
title: title,
|
||||||
description: $"{title}: {methodName}, tap here to see more.",
|
description: string.Format(Translations.Timeline.EventDescriptionFailedApplyingPatchTapForMore, title, methodName),
|
||||||
shortDescription: methodSimpleName,
|
shortDescription: methodSimpleName,
|
||||||
actionData: actionData,
|
actionData: actionData,
|
||||||
entryType: entryType,
|
entryType: entryType,
|
||||||
@@ -430,7 +431,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
title: EditorIndicationState.IndicationText[EditorIndicationState.IndicationStatus.Reloaded],
|
title: EditorIndicationState.IndicationText[EditorIndicationState.IndicationStatus.Reloaded],
|
||||||
description: patchedMethodsDisplayNames?.Length > 0
|
description: patchedMethodsDisplayNames?.Length > 0
|
||||||
? $"• {(truncated ? patchesList + "\n..." : patchesList)}"
|
? $"• {(truncated ? patchesList + "\n..." : patchesList)}"
|
||||||
: "No issues found",
|
: Translations.Timeline.EventDescriptionNoIssuesFound,
|
||||||
entryType: patchedMethodsDisplayNames?.Length > 0 ? EntryType.Parent : EntryType.Standalone,
|
entryType: patchedMethodsDisplayNames?.Length > 0 ? EntryType.Parent : EntryType.Standalone,
|
||||||
alertData: new AlertData(
|
alertData: new AlertData(
|
||||||
AlertEntryType.PatchApplied,
|
AlertEntryType.PatchApplied,
|
||||||
@@ -457,7 +458,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
alertType: AlertType.UnsupportedChange,
|
alertType: AlertType.UnsupportedChange,
|
||||||
title: EditorIndicationState.IndicationText[EditorIndicationState.IndicationStatus.Unsupported],
|
title: EditorIndicationState.IndicationText[EditorIndicationState.IndicationStatus.Unsupported],
|
||||||
description: patchedMembersDisplayNames?.Length > 0 ? $"• {(truncated ? patchesList + "\n...\n\nSee unsupported changes below" : patchesList + "\n\nSee unsupported changes below")}" : "See detailed entries below",
|
description: patchedMembersDisplayNames?.Length > 0 ? $"• {(truncated ? patchesList + "\n...\n\n" + Translations.Timeline.EventDescriptionSeeUnsupportedChangesBelow : patchesList + "\n\n" + Translations.Timeline.EventDescriptionSeeUnsupportedChangesBelow)}" : Translations.Timeline.EventDescriptionSeeDetailedEntriesBelow,
|
||||||
entryType: EntryType.Parent,
|
entryType: EntryType.Parent,
|
||||||
alertData: new AlertData(AlertEntryType.Failure, createdAt: timestamp, entryType: EntryType.Parent, patchedMembersDisplayNames: patchedMembersDisplayNames)
|
alertData: new AlertData(AlertEntryType.Failure, createdAt: timestamp, entryType: EntryType.Parent, patchedMembersDisplayNames: patchedMembersDisplayNames)
|
||||||
);
|
);
|
||||||
@@ -479,7 +480,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
alertType: AlertType.PartiallySupportedChange,
|
alertType: AlertType.PartiallySupportedChange,
|
||||||
title: EditorIndicationState.IndicationText[EditorIndicationState.IndicationStatus.PartiallySupported],
|
title: EditorIndicationState.IndicationText[EditorIndicationState.IndicationStatus.PartiallySupported],
|
||||||
description: patchedMethodsDisplayNames?.Length > 0 ? $"• {(truncated ? patchesList + "\n...\n\nSee partially applied changes below" : patchesList + "\n\nSee partially applied changes below")}" : "See detailed entries below",
|
description: patchedMethodsDisplayNames?.Length > 0 ? $"• {(truncated ? patchesList + "\n...\n\n" + Translations.Timeline.EventDescriptionSeePartiallyAppliedChangesBelow : patchesList + "\n\n" + Translations.Timeline.EventDescriptionSeePartiallyAppliedChangesBelow)}" : Translations.Timeline.EventDescriptionSeeDetailedEntriesBelow,
|
||||||
entryType: EntryType.Parent,
|
entryType: EntryType.Parent,
|
||||||
alertData: new AlertData(AlertEntryType.PartiallySupportedChange, createdAt: timestamp, entryType: EntryType.Parent, patchedMembersDisplayNames: patchedMethodsDisplayNames)
|
alertData: new AlertData(AlertEntryType.PartiallySupportedChange, createdAt: timestamp, entryType: EntryType.Parent, patchedMembersDisplayNames: patchedMethodsDisplayNames)
|
||||||
);
|
);
|
||||||
@@ -495,14 +496,13 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
alertType : AlertType.UndetectedChange,
|
alertType : AlertType.UndetectedChange,
|
||||||
title: EditorIndicationState.IndicationText[EditorIndicationState.IndicationStatus.Undetected],
|
title: EditorIndicationState.IndicationText[EditorIndicationState.IndicationStatus.Undetected],
|
||||||
description: "Code semantics didn't change (e.g. whitespace) or the change requires manual recompile.\n\n" +
|
description: Translations.Timeline.EventDescriptionUndetectedChange,
|
||||||
"Recompile to force-apply changes.",
|
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
RenderCompileButton();
|
RenderCompileButton();
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
OpenURLButton.Render("Docs", Constants.UndetectedChangesURL);
|
OpenURLButton.Render(Translations.Suggestions.ButtonDocs, Constants.UndetectedChangesURL);
|
||||||
GUILayout.Space(10f);
|
GUILayout.Space(10f);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -520,7 +520,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
InsertEntry(new AlertEntry(
|
InsertEntry(new AlertEntry(
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
alertType : AlertType.PartiallySupportedChange,
|
alertType : AlertType.PartiallySupportedChange,
|
||||||
title : detailed ? "Change partially applied" : ToString(partiallySupportedChange),
|
title : detailed ? Translations.Timeline.EventTitleChangePartiallyApplied : ToString(partiallySupportedChange),
|
||||||
description : description,
|
description : description,
|
||||||
shortDescription: detailed ? ToString(partiallySupportedChange) : null,
|
shortDescription: detailed ? ToString(partiallySupportedChange) : null,
|
||||||
actionData: () => {
|
actionData: () => {
|
||||||
@@ -529,7 +529,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
RenderCompileButton();
|
RenderCompileButton();
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (GetPartiallySupportedChangePref(partiallySupportedChange)) {
|
if (GetPartiallySupportedChangePref(partiallySupportedChange)) {
|
||||||
if (GUILayout.Button("Ignore this event type ", HotReloadWindowStyles.LinkStyle)) {
|
if (GUILayout.Button(Translations.Timeline.ButtonIgnoreEventType, HotReloadWindowStyles.LinkStyle)) {
|
||||||
HidePartiallySupportedChange(partiallySupportedChange);
|
HidePartiallySupportedChange(partiallySupportedChange);
|
||||||
HotReloadRunTab.RepaintInstant();
|
HotReloadRunTab.RepaintInstant();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#if UNITY_2021_2_OR_NEWER
|
#if UNITY_2021_2_OR_NEWER
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEditor.Overlays;
|
using UnityEditor.Overlays;
|
||||||
using UnityEngine.UIElements;
|
using UnityEngine.UIElements;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
@@ -8,7 +9,7 @@ using UnityEngine;
|
|||||||
using UnityEditor.Toolbars;
|
using UnityEditor.Toolbars;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
[Overlay(typeof(SceneView), "Hot Reload", true)]
|
[Overlay(typeof(SceneView), Translations.MenuItems.OverlayDescription, true)]
|
||||||
[Icon("Assets/HotReload/Editor/Resources/Icon_DarkMode.png")]
|
[Icon("Assets/HotReload/Editor/Resources/Icon_DarkMode.png")]
|
||||||
internal class HotReloadOverlay : ToolbarOverlay {
|
internal class HotReloadOverlay : ToolbarOverlay {
|
||||||
HotReloadOverlay() : base(HotReloadToolbarIndicationButton.id, HotReloadToolbarEventsButton.id, HotReloadToolbarRecompileButton.id) {
|
HotReloadOverlay() : base(HotReloadToolbarIndicationButton.id, HotReloadToolbarEventsButton.id, HotReloadToolbarRecompileButton.id) {
|
||||||
@@ -59,7 +60,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
internal HotReloadToolbarEventsButton() {
|
internal HotReloadToolbarEventsButton() {
|
||||||
icon = HotReloadState.ShowingRedDot ? GUIHelper.GetInvertibleIcon(InvertibleIcon.EventsNew) : GUIHelper.GetInvertibleIcon(InvertibleIcon.Events);
|
icon = HotReloadState.ShowingRedDot ? GUIHelper.GetInvertibleIcon(InvertibleIcon.EventsNew) : GUIHelper.GetInvertibleIcon(InvertibleIcon.Events);
|
||||||
tooltip = "Events";
|
tooltip = Translations.Timeline.EventsTooltip;
|
||||||
clicked += OnClick;
|
clicked += OnClick;
|
||||||
EditorApplication.update += Update;
|
EditorApplication.update += Update;
|
||||||
}
|
}
|
||||||
@@ -91,7 +92,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
private Texture2D refreshIcon => GUIHelper.GetInvertibleIcon(InvertibleIcon.Recompile);
|
private Texture2D refreshIcon => GUIHelper.GetInvertibleIcon(InvertibleIcon.Recompile);
|
||||||
internal HotReloadToolbarRecompileButton() {
|
internal HotReloadToolbarRecompileButton() {
|
||||||
icon = refreshIcon;
|
icon = refreshIcon;
|
||||||
tooltip = "Recompile";
|
tooltip = Translations.Miscellaneous.OverlayTooltipRecompile;
|
||||||
clicked += HotReloadRunTab.RecompileWithChecks;
|
clicked += HotReloadRunTab.RecompileWithChecks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,7 +117,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
/// Create Hot Reload overlay panel.
|
/// Create Hot Reload overlay panel.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override VisualElement CreatePanelContent() {
|
public override VisualElement CreatePanelContent() {
|
||||||
var root = new VisualElement() { name = "Hot Reload Indication" };
|
var root = new VisualElement() { name = Translations.UI.OverlayPanelName };
|
||||||
root.style.flexDirection = FlexDirection.Row;
|
root.style.flexDirection = FlexDirection.Row;
|
||||||
|
|
||||||
indicationIcon = new Image() { image = GUIHelper.GetLocalIcon(EditorIndicationState.greyIconPath) };
|
indicationIcon = new Image() { image = GUIHelper.GetLocalIcon(EditorIndicationState.greyIconPath) };
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
private const string AutoRecompileUnsupportedChangesImmediatelyKey = "HotReloadWindow.AutoRecompileUnsupportedChangesImmediately";
|
private const string AutoRecompileUnsupportedChangesImmediatelyKey = "HotReloadWindow.AutoRecompileUnsupportedChangesImmediately";
|
||||||
private const string AutoRecompileUnsupportedChangesOnExitPlayModeKey = "HotReloadWindow.AutoRecompileUnsupportedChangesOnExitPlayMode";
|
private const string AutoRecompileUnsupportedChangesOnExitPlayModeKey = "HotReloadWindow.AutoRecompileUnsupportedChangesOnExitPlayMode";
|
||||||
private const string AutoRecompileUnsupportedChangesInPlayModeKey = "HotReloadWindow.AutoRecompileUnsupportedChangesInPlayMode";
|
private const string AutoRecompileUnsupportedChangesInPlayModeKey = "HotReloadWindow.AutoRecompileUnsupportedChangesInPlayMode";
|
||||||
|
private const string AutoRecompileUnsupportedChangesInEditModeKey = "HotReloadWindow.AutoRecompileUnsupportedChangesInEditMode";
|
||||||
|
private const string AutoRecompileInspectorFieldsEditKey = "HotReloadWindow.AutoRecompileInspectorFieldsEdit";
|
||||||
private const string AllowDisableUnityAutoRefreshKey = "HotReloadWindow.AllowDisableUnityAutoRefresh";
|
private const string AllowDisableUnityAutoRefreshKey = "HotReloadWindow.AllowDisableUnityAutoRefresh";
|
||||||
private const string DefaultAutoRefreshKey = "HotReloadWindow.DefaultAutoRefresh";
|
private const string DefaultAutoRefreshKey = "HotReloadWindow.DefaultAutoRefresh";
|
||||||
private const string DefaultAutoRefreshModeKey = "HotReloadWindow.DefaultAutoRefreshMode";
|
private const string DefaultAutoRefreshModeKey = "HotReloadWindow.DefaultAutoRefreshMode";
|
||||||
@@ -56,6 +58,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
private const string DisableConsoleWindowKey = "HotReloadWindow.DisableConsoleWindow";
|
private const string DisableConsoleWindowKey = "HotReloadWindow.DisableConsoleWindow";
|
||||||
private const string DisableDetailedErrorReportingKey = "HotReloadWindow.DisableDetailedErrorReporting";
|
private const string DisableDetailedErrorReportingKey = "HotReloadWindow.DisableDetailedErrorReporting";
|
||||||
private const string DebuggerCompatibilityEnabledKey = "HotReloadWindow.DebuggerCompatibilityEnabled";
|
private const string DebuggerCompatibilityEnabledKey = "HotReloadWindow.DebuggerCompatibilityEnabled";
|
||||||
|
private const string PauseHotReloadInEditModeKey = "HotReloadWindow.PauseHotReloadInEditMode";
|
||||||
private const string RedeemLicenseEmailKey = "HotReloadWindow.RedeemLicenseEmail";
|
private const string RedeemLicenseEmailKey = "HotReloadWindow.RedeemLicenseEmail";
|
||||||
private const string RedeemLicenseInvoiceKey = "HotReloadWindow.RedeemLicenseInvoice";
|
private const string RedeemLicenseInvoiceKey = "HotReloadWindow.RedeemLicenseInvoice";
|
||||||
private const string RunTabEventsSuggestionsFoldoutKey = "HotReloadWindow.RunTabEventsSuggestionsFoldout";
|
private const string RunTabEventsSuggestionsFoldoutKey = "HotReloadWindow.RunTabEventsSuggestionsFoldout";
|
||||||
@@ -70,6 +73,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
private const string LoggedInlinedMethodsDialogueKey = "HotReloadWindow.LoggedInlinedMethodsDialogue";
|
private const string LoggedInlinedMethodsDialogueKey = "HotReloadWindow.LoggedInlinedMethodsDialogue";
|
||||||
private const string OpenedWindowAtLeastOnceKey = "HotReloadWindow.OpenedWindowAtLeastOnce";
|
private const string OpenedWindowAtLeastOnceKey = "HotReloadWindow.OpenedWindowAtLeastOnce";
|
||||||
private const string DeactivateHotReloadKey = "HotReloadWindow.DeactivateHotReload";
|
private const string DeactivateHotReloadKey = "HotReloadWindow.DeactivateHotReload";
|
||||||
|
private const string ActiveLocaleKey = "HotReloadWindow.ActiveLocale";
|
||||||
|
|
||||||
public const string DontShowPromptForDownloadKey = "ServerDownloader.DontShowPromptForDownload";
|
public const string DontShowPromptForDownloadKey = "ServerDownloader.DontShowPromptForDownload";
|
||||||
|
|
||||||
@@ -319,6 +323,16 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
set { EditorPrefs.SetBool(AutoRecompileUnsupportedChangesInPlayModeKey, value); }
|
set { EditorPrefs.SetBool(AutoRecompileUnsupportedChangesInPlayModeKey, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool AutoRecompileInspectorFieldsEdit {
|
||||||
|
get { return EditorPrefs.GetBool(AutoRecompileInspectorFieldsEditKey, false); }
|
||||||
|
set { EditorPrefs.SetBool(AutoRecompileInspectorFieldsEditKey, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool AutoRecompileUnsupportedChangesInEditMode {
|
||||||
|
get { return EditorPrefs.GetBool(AutoRecompileUnsupportedChangesInEditModeKey, true); }
|
||||||
|
set { EditorPrefs.SetBool(AutoRecompileUnsupportedChangesInEditModeKey, value); }
|
||||||
|
}
|
||||||
|
|
||||||
public static bool AllowDisableUnityAutoRefresh {
|
public static bool AllowDisableUnityAutoRefresh {
|
||||||
get { return EditorPrefs.GetBool(AllowDisableUnityAutoRefreshKey, false); }
|
get { return EditorPrefs.GetBool(AllowDisableUnityAutoRefreshKey, false); }
|
||||||
set { EditorPrefs.SetBool(AllowDisableUnityAutoRefreshKey, value); }
|
set { EditorPrefs.SetBool(AllowDisableUnityAutoRefreshKey, value); }
|
||||||
@@ -470,9 +484,19 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
set { EditorPrefs.SetBool(DisableDetailedErrorReportingKey, value); }
|
set { EditorPrefs.SetBool(DisableDetailedErrorReportingKey, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool PauseHotReloadInEditMode {
|
||||||
|
get { return EditorPrefs.GetBool(PauseHotReloadInEditModeKey, false); }
|
||||||
|
set { EditorPrefs.SetBool(PauseHotReloadInEditModeKey, value); }
|
||||||
|
}
|
||||||
|
|
||||||
public static bool AutoDisableHotReloadWithDebugger {
|
public static bool AutoDisableHotReloadWithDebugger {
|
||||||
get { return EditorPrefs.GetBool(DebuggerCompatibilityEnabledKey, true); }
|
get { return EditorPrefs.GetBool(DebuggerCompatibilityEnabledKey, true); }
|
||||||
set { EditorPrefs.SetBool(DebuggerCompatibilityEnabledKey, value); }
|
set { EditorPrefs.SetBool(DebuggerCompatibilityEnabledKey, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string ActiveLocale {
|
||||||
|
get { return EditorPrefs.GetString(ActiveLocaleKey, PackageConst.DefaultLocale); }
|
||||||
|
set { EditorPrefs.SetString(ActiveLocaleKey, value); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ using System.Net.Http;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SingularityGroup.HotReload.Editor.Cli;
|
using SingularityGroup.HotReload.Editor.Cli;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
|
using Translations = SingularityGroup.HotReload.Editor.Localization.Translations;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
static class DownloadUtility {
|
static class DownloadUtility {
|
||||||
@@ -19,11 +22,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetPackagePrefix(string version) {
|
public static string GetPackagePrefix(string version, string locale) {
|
||||||
if (PackageConst.IsAssetStoreBuild) {
|
if (PackageConst.IsAssetStoreBuild) {
|
||||||
return $"releases/asset-store/{version.Replace('.', '-')}";
|
return $"releases/asset-store/{(locale == Locale.SimplifiedChinese ? "zh/" : "")}{version.Replace('.', '-')}";
|
||||||
}
|
}
|
||||||
return $"releases/{version.Replace('.', '-')}";
|
return $"releases/{(locale == Locale.SimplifiedChinese ? "zh/" : "")}{version.Replace('.', '-')}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetDownloadUrl(string key) {
|
public static string GetDownloadUrl(string key) {
|
||||||
@@ -34,11 +37,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
// Get the http headers first to examine the content length
|
// Get the http headers first to examine the content length
|
||||||
using (var response = await client.GetAsync(requestUri, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false)) {
|
using (var response = await client.GetAsync(requestUri, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false)) {
|
||||||
if (response.StatusCode != HttpStatusCode.OK) {
|
if (response.StatusCode != HttpStatusCode.OK) {
|
||||||
throw new DownloadException($"Download failed with status code {response.StatusCode} and reason {response.ReasonPhrase}");
|
throw new DownloadException(string.Format(Translations.Errors.ExceptionDownloadFailed, response.StatusCode, response.ReasonPhrase));
|
||||||
}
|
}
|
||||||
var contentLength = response.Content.Headers.ContentLength;
|
var contentLength = response.Content.Headers.ContentLength;
|
||||||
if (!contentLength.HasValue) {
|
if (!contentLength.HasValue) {
|
||||||
throw new DownloadException("Download failed: Content length unknown");
|
throw new DownloadException(Translations.Errors.ExceptionDownloadContentLengthUnknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var fs = new FileStream(destinationFilePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None))
|
using (var fs = new FileStream(destinationFilePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None))
|
||||||
@@ -55,7 +58,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
await fs.FlushAsync().ConfigureAwait(false);
|
await fs.FlushAsync().ConfigureAwait(false);
|
||||||
if (fs.Length != contentLength.Value) {
|
if (fs.Length != contentLength.Value) {
|
||||||
throw new DownloadException("Download failed: download file is corrupted");
|
throw new DownloadException(Translations.Errors.ExceptionDownloadFileCorrupted);
|
||||||
}
|
}
|
||||||
return new DownloadResult(HttpStatusCode.OK, null);
|
return new DownloadResult(HttpStatusCode.OK, null);
|
||||||
}
|
}
|
||||||
@@ -66,11 +69,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (source == null)
|
if (source == null)
|
||||||
throw new ArgumentNullException(nameof(source));
|
throw new ArgumentNullException(nameof(source));
|
||||||
if (!source.CanRead)
|
if (!source.CanRead)
|
||||||
throw new ArgumentException("Has to be readable", nameof(source));
|
throw new ArgumentException(Translations.Utility.StreamHasToBeReadable, nameof(source));
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
throw new ArgumentNullException(nameof(destination));
|
throw new ArgumentNullException(nameof(destination));
|
||||||
if (!destination.CanWrite)
|
if (!destination.CanWrite)
|
||||||
throw new ArgumentException("Has to be writable", nameof(destination));
|
throw new ArgumentException(Translations.Utility.StreamHasToBeWritable, nameof(destination));
|
||||||
if (bufferSize < 0)
|
if (bufferSize < 0)
|
||||||
throw new ArgumentOutOfRangeException(nameof(bufferSize));
|
throw new ArgumentOutOfRangeException(nameof(bufferSize));
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SingularityGroup.HotReload.DTO;
|
using SingularityGroup.HotReload.DTO;
|
||||||
using SingularityGroup.HotReload.Editor.Cli;
|
using SingularityGroup.HotReload.Editor.Cli;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Translations = SingularityGroup.HotReload.Editor.Localization.Translations;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal class ServerDownloader : IProgress<float> {
|
internal class ServerDownloader : IProgress<float> {
|
||||||
@@ -80,7 +82,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
var error = $"{e.GetType().Name}: {e.Message}";
|
var error = $"{e.GetType().Name}: {e.Message}";
|
||||||
errors = (errors ?? new HashSet<string>());
|
errors = (errors ?? new HashSet<string>());
|
||||||
if (errors.Add(error)) {
|
if (errors.Add(error)) {
|
||||||
Log.Warning($"Download attempt failed. If the issue persists please reach out to customer support for assistance. Exception: {error}");
|
Log.Warning(Translations.Errors.ErrorDownloadFailed, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!sucess) {
|
if (!sucess) {
|
||||||
@@ -96,7 +98,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
};
|
};
|
||||||
// sending telemetry requires server to be running so we only attempt after server is downloaded
|
// sending telemetry requires server to be running so we only attempt after server is downloaded
|
||||||
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Error, StatFeature.Editor, StatEventType.Download), data).Forget();
|
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Error, StatFeature.Editor, StatEventType.Download), data).Forget();
|
||||||
Log.Info("Download succeeded!");
|
Log.Info(Translations.Errors.ErrorDownloadSucceeded);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int ERROR_ALREADY_EXISTS = 0xB7;
|
const int ERROR_ALREADY_EXISTS = 0xB7;
|
||||||
@@ -131,8 +133,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!File.Exists(customBinaryPath)) {
|
if (!File.Exists(customBinaryPath)) {
|
||||||
Log.Warning($"unable to find server binary for platform '{cliController.PlatformName}' at '{customBinaryPath}'. " +
|
Log.Warning(Translations.Errors.ErrorServerBinaryNotFound, cliController.PlatformName, customBinaryPath);
|
||||||
$"Will proceed with downloading the binary (default behavior)");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,14 +149,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch(IOException ex) {
|
} catch(IOException ex) {
|
||||||
Log.Warning("encountered exception when copying server binary in the specified custom executable path '{0}':\n{1}", customBinaryPath, ex);
|
Log.Warning(Translations.Errors.ErrorCopyingServerBinary, customBinaryPath, ex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static string GetDownloadUrl(ICliController cliController) {
|
static string GetDownloadUrl(ICliController cliController) {
|
||||||
const string version = PackageConst.ServerVersion;
|
const string version = PackageConst.ServerVersion;
|
||||||
var key = $"{DownloadUtility.GetPackagePrefix(version)}/server/{cliController.PlatformName}/{cliController.BinaryFileName}";
|
// NOTE: server is not translated at the moment so we always use english
|
||||||
|
var key = $"{DownloadUtility.GetPackagePrefix(version, Locale.English)}/server/{cliController.PlatformName}/{cliController.BinaryFileName}";
|
||||||
return DownloadUtility.GetDownloadUrl(key);
|
return DownloadUtility.GetDownloadUrl(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,18 +167,16 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
public Task<bool> PromptForDownload() {
|
public Task<bool> PromptForDownload() {
|
||||||
if (EditorUtility.DisplayDialog(
|
if (EditorUtility.DisplayDialog(
|
||||||
title: "Install platform specific components",
|
title: Translations.Dialogs.DialogTitleInstallComponents,
|
||||||
message: InstallDescription,
|
message: Translations.Dialogs.DialogMessageInstallComponents,
|
||||||
ok: "Install",
|
ok: Translations.Dialogs.DialogButtonInstall,
|
||||||
cancel: "More Info")
|
cancel: Translations.Dialogs.DialogButtonMoreInfo)
|
||||||
) {
|
) {
|
||||||
return EnsureDownloaded(HotReloadCli.controller, CancellationToken.None);
|
return EnsureDownloaded(HotReloadCli.controller, CancellationToken.None);
|
||||||
}
|
}
|
||||||
Application.OpenURL(Constants.AdditionalContentURL);
|
Application.OpenURL(Constants.AdditionalContentURL);
|
||||||
return Task.FromResult(false);
|
return Task.FromResult(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public const string InstallDescription = "For Hot Reload to work, additional components specific to your operating system have to be installed";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DownloadResult {
|
class DownloadResult {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.IO;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SingularityGroup.HotReload.Editor.Cli;
|
using SingularityGroup.HotReload.Editor.Cli;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using SingularityGroup.HotReload.RuntimeDependencies;
|
using SingularityGroup.HotReload.RuntimeDependencies;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
#if UNITY_EDITOR_WIN
|
#if UNITY_EDITOR_WIN
|
||||||
@@ -18,17 +19,17 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
string serverDir;
|
string serverDir;
|
||||||
if(!CliUtils.TryFindServerDir(out serverDir)) {
|
if(!CliUtils.TryFindServerDir(out serverDir)) {
|
||||||
progress?.Report(1);
|
progress?.Report(1);
|
||||||
return "unable to locate hot reload package";
|
return Translations.Utility.UnableToLocateHotReloadPackage;
|
||||||
}
|
}
|
||||||
var packageDir = Path.GetDirectoryName(Path.GetFullPath(serverDir));
|
var packageDir = Path.GetDirectoryName(Path.GetFullPath(serverDir));
|
||||||
var cacheDir = Path.GetFullPath(PackageConst.LibraryCachePath);
|
var cacheDir = Path.GetFullPath(PackageConst.LibraryCachePath);
|
||||||
if(Path.GetPathRoot(packageDir) != Path.GetPathRoot(cacheDir)) {
|
if(Path.GetPathRoot(packageDir) != Path.GetPathRoot(cacheDir)) {
|
||||||
progress?.Report(1);
|
progress?.Report(1);
|
||||||
return "unable to update package because it is located on a different drive than the unity project";
|
return Translations.Utility.UnableToUpdatePackageDifferentDrive;
|
||||||
}
|
}
|
||||||
var updatedPackageCopy = BackupPackage(packageDir, version);
|
var updatedPackageCopy = BackupPackage(packageDir, version);
|
||||||
|
|
||||||
var key = $"{DownloadUtility.GetPackagePrefix(version)}/HotReload.zip";
|
var key = $"{DownloadUtility.GetPackagePrefix(version, PackageConst.DefaultLocale)}/HotReload.zip";
|
||||||
var url = DownloadUtility.GetDownloadUrl(key);
|
var url = DownloadUtility.GetDownloadUrl(key);
|
||||||
var targetFileName = $"HotReload{version.Replace('.', '-')}.zip";
|
var targetFileName = $"HotReload{version.Replace('.', '-')}.zip";
|
||||||
var targetFilePath = CliUtils.GetTempDownloadFilePath(targetFileName);
|
var targetFilePath = CliUtils.GetTempDownloadFilePath(targetFileName);
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c856b3b3ce5f41c7aaebf7b543be697a
|
||||||
|
timeCreated: 1759652305
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class About {
|
||||||
|
// Log Messages
|
||||||
|
public static string LogNoLogsFound;
|
||||||
|
public static string LogFailedOpeningLogFile;
|
||||||
|
public static string LogBuildTargetSwitching;
|
||||||
|
|
||||||
|
// About/Help Tab
|
||||||
|
public static string AboutTitle;
|
||||||
|
public static string AboutDescription;
|
||||||
|
public static string AboutVersionInfo;
|
||||||
|
public static string AboutChangelog;
|
||||||
|
public static string AboutFeatures;
|
||||||
|
public static string AboutImprovements;
|
||||||
|
public static string AboutFixes;
|
||||||
|
public static string AboutToday;
|
||||||
|
public static string AboutYesterday;
|
||||||
|
public static string AboutDaysAgo;
|
||||||
|
public static string AboutOneMonthAgo;
|
||||||
|
public static string AboutMonthsAgo;
|
||||||
|
public static string AboutOneYearAgo;
|
||||||
|
public static string AboutYearsAgo;
|
||||||
|
|
||||||
|
// About Tab Buttons
|
||||||
|
public static string ButtonDocumentation;
|
||||||
|
public static string ButtonContact;
|
||||||
|
public static string ButtonUnityForum;
|
||||||
|
public static string ButtonReportIssue;
|
||||||
|
public static string ButtonJoinDiscord;
|
||||||
|
public static string ButtonSeeMore;
|
||||||
|
public static string ButtonManageLicense;
|
||||||
|
public static string ButtonManageAccount;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Log Messages
|
||||||
|
LogNoLogsFound = "No logs found";
|
||||||
|
LogFailedOpeningLogFile = "Failed opening log file.";
|
||||||
|
LogBuildTargetSwitching = "Build target is switching to {0}.";
|
||||||
|
|
||||||
|
// About/Help Tab
|
||||||
|
AboutTitle = "Help";
|
||||||
|
AboutDescription = "Info and support for Hot Reload for Unity.";
|
||||||
|
AboutVersionInfo = " Hot Reload version {0}. ";
|
||||||
|
AboutChangelog = "Changelog";
|
||||||
|
AboutFeatures = "Features:";
|
||||||
|
AboutImprovements = "Improvements:";
|
||||||
|
AboutFixes = "Fixes:";
|
||||||
|
AboutToday = "Today";
|
||||||
|
AboutYesterday = "Yesterday";
|
||||||
|
AboutDaysAgo = "{0} days ago";
|
||||||
|
AboutOneMonthAgo = "one month ago";
|
||||||
|
AboutMonthsAgo = "{0} months ago";
|
||||||
|
AboutOneYearAgo = "one year ago";
|
||||||
|
AboutYearsAgo = "{0} years ago";
|
||||||
|
|
||||||
|
// About Tab Buttons
|
||||||
|
ButtonDocumentation = "Documentation";
|
||||||
|
ButtonContact = "Contact";
|
||||||
|
ButtonUnityForum = "Unity Forum";
|
||||||
|
ButtonReportIssue = "Report issue";
|
||||||
|
ButtonJoinDiscord = "Join Discord";
|
||||||
|
ButtonSeeMore = "See More";
|
||||||
|
ButtonManageLicense = "Manage License";
|
||||||
|
ButtonManageAccount = "Manage Account";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Log Messages
|
||||||
|
LogNoLogsFound = "未找到日志";
|
||||||
|
LogFailedOpeningLogFile = "打开日志文件失败。";
|
||||||
|
LogBuildTargetSwitching = "构建目标正在切换到 {0}。";
|
||||||
|
|
||||||
|
// About/Help Tab
|
||||||
|
AboutTitle = "帮助";
|
||||||
|
AboutDescription = "Unity Hot Reload 的信息和支持。";
|
||||||
|
AboutVersionInfo = " Hot Reload 版本 {0}。";
|
||||||
|
AboutChangelog = "更新日志";
|
||||||
|
AboutFeatures = "新功能:";
|
||||||
|
AboutImprovements = "改进:";
|
||||||
|
AboutFixes = "修复:";
|
||||||
|
AboutToday = "今天";
|
||||||
|
AboutYesterday = "昨天";
|
||||||
|
AboutDaysAgo = "{0} 天前";
|
||||||
|
AboutOneMonthAgo = "一个月前";
|
||||||
|
AboutMonthsAgo = "{0} 个月前";
|
||||||
|
AboutOneYearAgo = "一年前";
|
||||||
|
AboutYearsAgo = "{0} 年前";
|
||||||
|
|
||||||
|
// About Tab Buttons
|
||||||
|
ButtonDocumentation = "文档";
|
||||||
|
ButtonContact = "联系我们";
|
||||||
|
ButtonUnityForum = "Unity 论坛";
|
||||||
|
ButtonReportIssue = "报告问题";
|
||||||
|
ButtonJoinDiscord = "加入 Discord";
|
||||||
|
ButtonSeeMore = "查看更多";
|
||||||
|
ButtonManageLicense = "管理许可证";
|
||||||
|
ButtonManageAccount = "管理帐户";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 155269da640bb89428bf5b3d415878c9
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Common {
|
||||||
|
// Common Buttons
|
||||||
|
public static string ButtonSubmit;
|
||||||
|
public static string ButtonHide;
|
||||||
|
public static string ButtonClear;
|
||||||
|
public static string ButtonStart;
|
||||||
|
public static string ButtonStop;
|
||||||
|
public static string ButtonRecompile;
|
||||||
|
public static string ButtonProceed;
|
||||||
|
public static string ButtonYes;
|
||||||
|
public static string ButtonNo;
|
||||||
|
public static string ButtonCancel;
|
||||||
|
public static string ButtonOpenInBrowser;
|
||||||
|
public static string ButtonLogin;
|
||||||
|
public static string ButtonLogout;
|
||||||
|
public static string ButtonRedeem;
|
||||||
|
public static string ButtonSkip;
|
||||||
|
public static string ButtonUpgrade;
|
||||||
|
public static string ButtonFixAll;
|
||||||
|
public static string ButtonGoBack;
|
||||||
|
public static string ButtonActivatePromoCode;
|
||||||
|
public static string ButtonActivateLicense;
|
||||||
|
public static string ButtonOpenLogFile;
|
||||||
|
public static string ButtonBrowseAllLogs;
|
||||||
|
public static string ButtonInfo;
|
||||||
|
public static string ButtonNotNow;
|
||||||
|
public static string ButtonStopAndRecompile;
|
||||||
|
|
||||||
|
// Common Labels
|
||||||
|
public static string LabelEmail;
|
||||||
|
public static string LabelPassword;
|
||||||
|
public static string LabelPromoCode;
|
||||||
|
public static string LabelCompanySize;
|
||||||
|
public static string LabelInvoiceNumber;
|
||||||
|
public static string LabelShowOnStartup;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Common Buttons
|
||||||
|
ButtonSubmit = "Submit";
|
||||||
|
ButtonHide = "Hide";
|
||||||
|
ButtonClear = "Clear";
|
||||||
|
ButtonStart = " Start";
|
||||||
|
ButtonStop = " Stop";
|
||||||
|
ButtonRecompile = " Recompile";
|
||||||
|
ButtonProceed = "Proceed";
|
||||||
|
ButtonYes = "Yes";
|
||||||
|
ButtonNo = "No";
|
||||||
|
ButtonCancel = "Cancel";
|
||||||
|
ButtonOpenInBrowser = "Open in browser";
|
||||||
|
ButtonLogin = "Login";
|
||||||
|
ButtonLogout = "Logout";
|
||||||
|
ButtonRedeem = "Redeem";
|
||||||
|
ButtonSkip = "Skip";
|
||||||
|
ButtonUpgrade = "Upgrade";
|
||||||
|
ButtonFixAll = "Fix All";
|
||||||
|
ButtonGoBack = "Go Back";
|
||||||
|
ButtonActivatePromoCode = "Activate promo code";
|
||||||
|
ButtonActivateLicense = "Activate License";
|
||||||
|
ButtonOpenLogFile = "Open Log File";
|
||||||
|
ButtonBrowseAllLogs = "Browse all logs";
|
||||||
|
ButtonInfo = " Info";
|
||||||
|
ButtonNotNow = "Not now";
|
||||||
|
ButtonStopAndRecompile = "Stop and Recompile";
|
||||||
|
|
||||||
|
// Common Labels
|
||||||
|
LabelEmail = "Email";
|
||||||
|
LabelPassword = "Password";
|
||||||
|
LabelPromoCode = "Promo code";
|
||||||
|
LabelCompanySize = "Company size (number of employees)";
|
||||||
|
LabelInvoiceNumber = "Invoice number/Order ID";
|
||||||
|
LabelShowOnStartup = "Show On Startup";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Common Buttons
|
||||||
|
ButtonSubmit = "提交";
|
||||||
|
ButtonHide = "隐藏";
|
||||||
|
ButtonClear = "清除";
|
||||||
|
ButtonStart = " 开始";
|
||||||
|
ButtonStop = " 停止";
|
||||||
|
ButtonRecompile = " 重新编译";
|
||||||
|
ButtonProceed = "继续";
|
||||||
|
ButtonYes = "是";
|
||||||
|
ButtonNo = "否";
|
||||||
|
ButtonCancel = "取消";
|
||||||
|
ButtonOpenInBrowser = "在浏览器中打开";
|
||||||
|
ButtonLogin = "登录";
|
||||||
|
ButtonLogout = "登出";
|
||||||
|
ButtonRedeem = "兑换";
|
||||||
|
ButtonSkip = "跳过";
|
||||||
|
ButtonUpgrade = "升级";
|
||||||
|
ButtonFixAll = "全部修复";
|
||||||
|
ButtonGoBack = "返回";
|
||||||
|
ButtonActivatePromoCode = "激活促销代码";
|
||||||
|
ButtonActivateLicense = "激活许可证";
|
||||||
|
ButtonOpenLogFile = "打开日志文件";
|
||||||
|
ButtonBrowseAllLogs = "浏览所有日志";
|
||||||
|
ButtonInfo = " 信息";
|
||||||
|
ButtonNotNow = "以后再说";
|
||||||
|
ButtonStopAndRecompile = "停止并重新编译";
|
||||||
|
|
||||||
|
// Common Labels
|
||||||
|
LabelEmail = "电子邮件";
|
||||||
|
LabelPassword = "密码";
|
||||||
|
LabelPromoCode = "促销代码";
|
||||||
|
LabelCompanySize = "公司规模(员工人数)";
|
||||||
|
LabelInvoiceNumber = "发票号码/订单 ID";
|
||||||
|
LabelShowOnStartup = "启动时显示";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2fea73e8304102e4a805c3d00653b84b
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Dialogs {
|
||||||
|
// Dialogs
|
||||||
|
public static string DialogTitleRecompile;
|
||||||
|
public static string DialogMessageRecompile;
|
||||||
|
public static string DialogTitleStopPlayMode;
|
||||||
|
public static string DialogMessageStopPlayMode;
|
||||||
|
public static string DialogTitleRecoverPassword;
|
||||||
|
public static string DialogMessageRecoverPassword;
|
||||||
|
public static string DialogTitleRateApp;
|
||||||
|
public static string DialogMessageRateApp;
|
||||||
|
public static string DialogTitleDeactivate;
|
||||||
|
public static string DialogMessageDeactivate;
|
||||||
|
public static string DialogButtonDeactivate;
|
||||||
|
public static string DialogTitleRestartServer;
|
||||||
|
public static string DialogMessageRestartAssetRefresh;
|
||||||
|
public static string DialogMessageRestartConsoleWindow;
|
||||||
|
public static string DialogMessageRestartErrorReporting;
|
||||||
|
public static string DialogButtonRestartHotReload;
|
||||||
|
public static string DialogButtonRestartServer;
|
||||||
|
public static string DialogButtonDontRestart;
|
||||||
|
public static string DialogTitleInstallComponents;
|
||||||
|
public static string DialogMessageInstallComponents;
|
||||||
|
public static string DialogButtonInstall;
|
||||||
|
public static string DialogButtonMoreInfo;
|
||||||
|
public static string DialogTitleSwitchBuildTarget;
|
||||||
|
public static string DialogMessageSwitchBuildTarget;
|
||||||
|
public static string DialogButtonSwitchToStandalone;
|
||||||
|
|
||||||
|
// About Tab Dialog Messages
|
||||||
|
public static string DialogManageLicenseMessage;
|
||||||
|
public static string DialogManageAccountMessage;
|
||||||
|
public static string DialogReportIssueMessage;
|
||||||
|
|
||||||
|
// Update Dialog
|
||||||
|
public static string DialogTitleUpdateFormat;
|
||||||
|
public static string DialogMessageUpdateFormat;
|
||||||
|
public static string DialogButtonUpdate;
|
||||||
|
|
||||||
|
// Update Server Dialog
|
||||||
|
public static string DialogMessageRestartUpdate;
|
||||||
|
public static string DialogMessageRestartFieldInitializer;
|
||||||
|
public static string DialogMessageRestartExposeServer;
|
||||||
|
public static string DialogTitleHotReload;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Dialogs
|
||||||
|
DialogTitleRecompile = "Hot Reload auto-applies changes";
|
||||||
|
DialogMessageRecompile = "Using the Recompile button is only necessary when Hot Reload fails to apply your changes. \n\nDo you wish to proceed?";
|
||||||
|
DialogTitleStopPlayMode = "Stop Play Mode and Recompile?";
|
||||||
|
DialogMessageStopPlayMode = "Using the Recompile button will stop Play Mode.\n\nDo you wish to proceed?";
|
||||||
|
DialogTitleRecoverPassword = "Recover password";
|
||||||
|
DialogMessageRecoverPassword = "Use company code 'naughtycult' and the email you signed up with in order to recover your account.";
|
||||||
|
DialogTitleRateApp = "Rate Hot Reload";
|
||||||
|
DialogMessageRateApp = "Thank you for using Hot Reload!\n\nPlease consider leaving a review on the Asset Store to support us.";
|
||||||
|
DialogTitleDeactivate = "Hot Reload";
|
||||||
|
DialogMessageDeactivate = "Hot Reload will be completely deactivated (unusable) until you activate it again.\n\nDo you want to proceed?";
|
||||||
|
DialogButtonDeactivate = "Deactivate";
|
||||||
|
DialogTitleRestartServer = "Hot Reload";
|
||||||
|
DialogMessageRestartAssetRefresh = "When changing 'Asset refresh', the Hot Reload server must be restarted for this to take effect.\nDo you want to restart it now?";
|
||||||
|
DialogMessageRestartConsoleWindow = "When changing 'Hide console window on start', the Hot Reload server must be restarted for this to take effect.\nDo you want to restart it now?";
|
||||||
|
DialogMessageRestartErrorReporting = "When changing 'Disable Detailed Error Reporting', the Hot Reload server must be restarted for this to take effect.\nDo you want to restart it now?";
|
||||||
|
DialogButtonRestartHotReload = "Restart Hot Reload";
|
||||||
|
DialogButtonRestartServer = "Restart server";
|
||||||
|
DialogButtonDontRestart = "Don't restart";
|
||||||
|
DialogTitleInstallComponents = "Install platform specific components";
|
||||||
|
DialogMessageInstallComponents = "For Hot Reload to work, additional components specific to your operating system have to be installed";
|
||||||
|
DialogButtonInstall = "Install";
|
||||||
|
DialogButtonMoreInfo = "More Info";
|
||||||
|
DialogTitleSwitchBuildTarget = "Switch Build Target";
|
||||||
|
DialogMessageSwitchBuildTarget = "Switching the build target can take a while depending on project size.";
|
||||||
|
DialogButtonSwitchToStandalone = "Switch to Standalone";
|
||||||
|
|
||||||
|
// About Tab Dialog Messages
|
||||||
|
DialogManageLicenseMessage = "Upgrade/downgrade/edit your subscription and edit payment info.";
|
||||||
|
DialogManageAccountMessage = "Login with company code 'naughtycult'. Use the email you signed up with. Your initial password was sent to you by email.";
|
||||||
|
DialogReportIssueMessage = "Report issue in our public issue tracker. Requires gitlab.com account (if you don't have one and are not willing to make it, please contact us by other means such as our website).";
|
||||||
|
|
||||||
|
// Update Dialog
|
||||||
|
DialogTitleUpdateFormat = "Update To v{0}";
|
||||||
|
DialogMessageUpdateFormat = "By pressing 'Update' the Hot Reload package will be updated to v{0}";
|
||||||
|
DialogButtonUpdate = "Update";
|
||||||
|
|
||||||
|
// Update Server Dialog
|
||||||
|
DialogMessageRestartUpdate = "When updating Hot Reload, the server must be restarted for the update to take effect.\nDo you want to restart it now?";
|
||||||
|
DialogMessageRestartFieldInitializer = "When changing 'Apply field initializer edits to existing class instances' setting, the Hot Reload server must restart for it to take effect.\nDo you want to restart it now?";
|
||||||
|
DialogMessageRestartExposeServer = "When changing '{0}', the Hot Reload server must be restarted for this to take effect.\nDo you want to restart it now?";
|
||||||
|
DialogTitleHotReload = "Hot Reload";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Dialogs
|
||||||
|
DialogTitleRecompile = "Hot Reload 自动应用更改";
|
||||||
|
DialogMessageRecompile = "仅当 Hot Reload 未能应用您的更改时,才需要使用“重新编译”按钮。\n\n您希望继续吗?";
|
||||||
|
DialogTitleStopPlayMode = "停止播放模式并重新编译?";
|
||||||
|
DialogMessageStopPlayMode = "使用“重新编译”按钮将停止播放模式。\n\n您希望继续吗?";
|
||||||
|
DialogTitleRecoverPassword = "恢复密码";
|
||||||
|
DialogMessageRecoverPassword = "使用公司代码 'naughtycult' 和您注册时使用的电子邮件来恢复您的帐户。";
|
||||||
|
DialogTitleRateApp = "为 Hot Reload 评分";
|
||||||
|
DialogMessageRateApp = "感谢您使用 Hot Reload!\n\n请考虑在 Asset Store 上留下评论以支持我们。";
|
||||||
|
DialogTitleDeactivate = "Hot Reload";
|
||||||
|
DialogMessageDeactivate = "Hot Reload 将被完全停用(无法使用),直到您再次激活它。\n\n您希望继续吗?";
|
||||||
|
DialogButtonDeactivate = "停用";
|
||||||
|
DialogTitleRestartServer = "Hot Reload";
|
||||||
|
DialogMessageRestartAssetRefresh = "更改“资源刷新”时,必须重新启动 Hot Reload 服务器才能生效。\n您希望现在重新启动吗?";
|
||||||
|
DialogMessageRestartConsoleWindow = "更改“启动时隐藏控制台窗口”时,必须重新启动 Hot Reload 服务器才能生效。\n您希望现在重新启动吗?";
|
||||||
|
DialogMessageRestartErrorReporting = "更改“禁用详细错误报告”时,必须重新启动 Hot Reload 服务器才能生效。\n您希望现在重新启动吗?";
|
||||||
|
DialogButtonRestartHotReload = "重新启动 Hot Reload";
|
||||||
|
DialogButtonRestartServer = "重新启动服务器";
|
||||||
|
DialogButtonDontRestart = "不重新启动";
|
||||||
|
DialogTitleInstallComponents = "安装特定于平台的组件";
|
||||||
|
DialogMessageInstallComponents = "为了让 Hot Reload 工作,必须安装特定于您操作系统的附加组件";
|
||||||
|
DialogButtonInstall = "安装";
|
||||||
|
DialogButtonMoreInfo = "更多信息";
|
||||||
|
DialogTitleSwitchBuildTarget = "切换构建目标";
|
||||||
|
DialogMessageSwitchBuildTarget = "切换构建目标可能需要一段时间,具体取决于项目大小。";
|
||||||
|
DialogButtonSwitchToStandalone = "切换到独立平台";
|
||||||
|
|
||||||
|
// About Tab Dialog Messages
|
||||||
|
DialogManageLicenseMessage = "升级/降级/编辑您的订阅并编辑付款信息。";
|
||||||
|
DialogManageAccountMessage = "使用公司代码 'naughtycult' 登录。使用您注册时使用的电子邮件。您的初始密码已通过电子邮件发送给您。";
|
||||||
|
DialogReportIssueMessage = "在我们的公共问题跟踪器中报告问题。需要 gitlab.com 帐户(如果您没有并且不愿意创建,请通过其他方式与我们联系,例如我们的网站)。";
|
||||||
|
|
||||||
|
// Update Dialog
|
||||||
|
DialogTitleUpdateFormat = "更新到 v{0}";
|
||||||
|
DialogMessageUpdateFormat = "按下“更新”后,Hot Reload 软件包将更新到 v{0}";
|
||||||
|
DialogButtonUpdate = "更新";
|
||||||
|
|
||||||
|
// Update Server Dialog
|
||||||
|
DialogMessageRestartUpdate = "更新 Hot Reload 时,必须重新启动服务器才能使更新生效。\n您希望现在重新启动吗?";
|
||||||
|
DialogMessageRestartFieldInitializer = "更改“将字段初始化程序编辑应用于现有类实例”设置时,必须重新启动 Hot Reload 服务器才能生效。\n您希望现在重新启动吗?";
|
||||||
|
DialogMessageRestartExposeServer = "更改“{0}”时,必须重新启动 Hot Reload 服务器才能生效。\n您希望现在重新启动吗?";
|
||||||
|
DialogTitleHotReload = "Hot Reload";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 18bf971e42f1c6b40a2f22f0cc76411f
|
||||||
@@ -0,0 +1,328 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Errors {
|
||||||
|
// Error Messages
|
||||||
|
public static string ErrorInvalidInput;
|
||||||
|
public static string ErrorNetworkIssue;
|
||||||
|
public static string ErrorDownloadFailed;
|
||||||
|
public static string ErrorServerBinaryNotFound;
|
||||||
|
public static string ErrorCopyingServerBinary;
|
||||||
|
public static string ErrorDownloadSucceeded;
|
||||||
|
public static string ErrorContactSupport;
|
||||||
|
public static string ErrorEnterNumber;
|
||||||
|
public static string ErrorEnterEmail;
|
||||||
|
public static string ErrorValidEmail;
|
||||||
|
public static string ErrorEnterPassword;
|
||||||
|
public static string ErrorMailExtensions;
|
||||||
|
public static string ErrorEnterInvoiceNumber;
|
||||||
|
public static string ErrorInvalidEmailAddress;
|
||||||
|
public static string ErrorLicenseInvoiceRedeemed;
|
||||||
|
public static string ErrorEmailAlreadyUsed;
|
||||||
|
public static string ErrorInvoiceNotFound;
|
||||||
|
public static string ErrorInvoiceRefunded;
|
||||||
|
public static string ErrorPromoCodeInvalid;
|
||||||
|
public static string ErrorPromoCodeUsed;
|
||||||
|
public static string ErrorPromoCodeExpired;
|
||||||
|
public static string ErrorLicenseExtended;
|
||||||
|
public static string ErrorPromoCodeActivation;
|
||||||
|
public static string ErrorPromoCodeNetwork;
|
||||||
|
|
||||||
|
// Warning Messages
|
||||||
|
public static string WarningUnityJobHotReloaded;
|
||||||
|
public static string WarningBuildSettingsNotSupported;
|
||||||
|
public static string WarningInlinedMethods;
|
||||||
|
public static string WarningMacOSVersionDetectionFailed;
|
||||||
|
public static string WarningUnexpectedSaveProblem;
|
||||||
|
public static string WarningRedeemStatusUnknown;
|
||||||
|
public static string WarningRedeemUnknownError;
|
||||||
|
public static string WarningFailedToRunServerCommand;
|
||||||
|
public static string WarningVersionCheckException;
|
||||||
|
public static string WarningVersionCheckFailed;
|
||||||
|
public static string WarningUpdateIssueFailed;
|
||||||
|
public static string WarningUpdatePackageFailed;
|
||||||
|
public static string WarningUnableToFindPackage;
|
||||||
|
public static string WarningCompileCheckerIssue;
|
||||||
|
public static string WarningFailedToStartServer;
|
||||||
|
public static string WarningNoSlnFileFound;
|
||||||
|
public static string WarningPreparingBuildInfoFailed;
|
||||||
|
public static string WarningInlineMethodChecker;
|
||||||
|
public static string WarningRefreshingAssetFailed;
|
||||||
|
public static string WarningFailedDeterminingRegistration;
|
||||||
|
public static string WarningRedeemingLicenseFailed;
|
||||||
|
public static string WarningInitializingEventEntries;
|
||||||
|
public static string WarningPersistingEventEntries;
|
||||||
|
public static string WarningIndicationTextNotFound;
|
||||||
|
|
||||||
|
// Info Messages
|
||||||
|
public static string InfoDebuggerAttached;
|
||||||
|
public static string InfoInspectorFieldRecompile;
|
||||||
|
public static string InfoDefaultProjectGeneration;
|
||||||
|
public static string ErrorFreeChargesUnavailable;
|
||||||
|
|
||||||
|
// Exception Messages
|
||||||
|
public static string ExceptionExpectedZipFile;
|
||||||
|
public static string ExceptionZipFileNotFound;
|
||||||
|
public static string ExceptionUnzipFailed;
|
||||||
|
public static string ExceptionDownloadFailed;
|
||||||
|
public static string ExceptionUnableToFindManifest;
|
||||||
|
public static string ErrorRedeemRequestFailed;
|
||||||
|
public static string ErrorFailedDeserializingRedeem;
|
||||||
|
public static string ErrorRedeemingWebException;
|
||||||
|
public static string ExceptionDownloadContentLengthUnknown;
|
||||||
|
public static string ExceptionDownloadFileCorrupted;
|
||||||
|
public static string ExceptionFailedToFindAppDirectory;
|
||||||
|
public static string ExceptionCouldNotStartCodePatcher;
|
||||||
|
|
||||||
|
// Info/Debug Messages
|
||||||
|
public static string InfoManifestSearch;
|
||||||
|
public static string InfoOmitProjectsForPlayerBuild;
|
||||||
|
public static string InfoSeparator;
|
||||||
|
public static string InfoOmittedEditorProject;
|
||||||
|
public static string InfoFoundProjectNamed;
|
||||||
|
|
||||||
|
// Project Generation Warnings
|
||||||
|
public static string WarningPostProcessorException;
|
||||||
|
public static string WarningPostProcessorFailedProject;
|
||||||
|
public static string WarningPostProcessorFailedSolution;
|
||||||
|
public static string WarningPostProcessorNoDefaultConstructor;
|
||||||
|
public static string WarningPostProcessorConstructorException;
|
||||||
|
public static string WarningPostProcessorUnknownException;
|
||||||
|
|
||||||
|
// Parse Errors
|
||||||
|
public static string ErrorParseError;
|
||||||
|
|
||||||
|
// Android Manifest Comments
|
||||||
|
public static string CommentAndroidCleartextPermit;
|
||||||
|
public static string CommentAndroidCleartextDevelopmentOnly;
|
||||||
|
|
||||||
|
// Debug Messages
|
||||||
|
public static string DebugDetouringMethodFailed;
|
||||||
|
|
||||||
|
// Package Update Errors
|
||||||
|
public static string ErrorRequestFailedStatusCode;
|
||||||
|
public static string ErrorInvalidPackageJson;
|
||||||
|
public static string ErrorInvalidVersionInPackageJson;
|
||||||
|
public static string ErrorUnableToFindManifestJson;
|
||||||
|
public static string ErrorNoDependenciesInManifest;
|
||||||
|
public static string ErrorDependenciesNullInManifest;
|
||||||
|
public static string ErrorNoDependenciesSpecified;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Error Messages
|
||||||
|
ErrorInvalidInput = "Invalid input";
|
||||||
|
ErrorNetworkIssue = "Something went wrong. Please check your internet connection.";
|
||||||
|
ErrorContactSupport = "Something went wrong. Please contact support if the issue persists.";
|
||||||
|
ErrorDownloadFailed = "Download attempt failed. If the issue persists please reach out to customer support for assistance. Exception: {0}";
|
||||||
|
ErrorServerBinaryNotFound = "unable to find server binary for platform '{0}' at '{1}'. Will proceed with downloading the binary (default behavior)";
|
||||||
|
ErrorCopyingServerBinary = "encountered exception when copying server binary in the specified custom executable path '{0}':\n{1}";
|
||||||
|
ErrorDownloadSucceeded = "Download succeeded!";
|
||||||
|
ErrorEnterNumber = "Please enter a number.";
|
||||||
|
ErrorEnterEmail = "Please enter your email address.";
|
||||||
|
ErrorValidEmail = "Please enter a valid email address.";
|
||||||
|
ErrorEnterPassword = "Please enter your password.";
|
||||||
|
ErrorMailExtensions = "Mail extensions (in a form of 'username+suffix@example.com') are not supported yet. Please provide your original email address (such as 'username@example.com' without '+suffix' part) as we're working on resolving this issue.";
|
||||||
|
ErrorEnterInvoiceNumber = "Please enter invoice number / order ID.";
|
||||||
|
ErrorInvalidEmailAddress = "Please enter a valid email address.";
|
||||||
|
ErrorLicenseInvoiceRedeemed = "The invoice number/order ID you're trying to use has already been applied to redeem a license. Please enter a different invoice number/order ID. If you have already redeemed a license for another email, you may proceed to the next step.";
|
||||||
|
ErrorEmailAlreadyUsed = "The provided email has already been used to redeem a license. If you have previously redeemed a license, you can proceed to the next step and use your existing credentials. If not, please input a different email address.";
|
||||||
|
ErrorInvoiceNotFound = "The invoice was not found. Please ensure that you've entered the correct invoice number/order ID.";
|
||||||
|
ErrorInvoiceRefunded = "The purchase has been refunded. Please enter a different invoice number/order ID.";
|
||||||
|
ErrorPromoCodeInvalid = "Your promo code is invalid. Please ensure that you have entered the correct promo code.";
|
||||||
|
ErrorPromoCodeUsed = "Your promo code has already been used.";
|
||||||
|
ErrorPromoCodeExpired = "Your promo code has expired.";
|
||||||
|
ErrorLicenseExtended = "Your license has already been activated with a promo code. Only one promo code activation per license is allowed.";
|
||||||
|
ErrorPromoCodeActivation = "We encountered an error while activating your promo code. Please try again. If the issue persists, please contact our customer support team for assistance.";
|
||||||
|
ErrorPromoCodeNetwork = "There is an issue connecting to our servers. Please check your internet connection or contact customer support if the issue persists.";
|
||||||
|
|
||||||
|
// Warning Messages
|
||||||
|
WarningUnityJobHotReloaded = "A unity job was hot reloaded. This will cause a harmless warning that can be ignored. More info about this can be found here: {0}";
|
||||||
|
WarningBuildSettingsNotSupported = "Hot Reload was not included in the build because one or more build settings were not supported.";
|
||||||
|
WarningInlinedMethods = "Unity Editor inlines simple methods when it's in \"Release\" mode, which Hot Reload cannot patch.\n\nSwitch to Debug mode to avoid this problem, or let Hot Reload fully recompile Unity when this issue occurs.";
|
||||||
|
WarningMacOSVersionDetectionFailed = "Failed to detect MacOS version, if Hot Reload fails to start, please contact support.";
|
||||||
|
WarningUnexpectedSaveProblem = "Unexpected problem unable to save HotReloadSettingsObject";
|
||||||
|
WarningRedeemStatusUnknown = "Redeeming license failed: unknown status received";
|
||||||
|
WarningRedeemUnknownError = "Redeeming a license failed: uknown error encountered";
|
||||||
|
WarningFailedToRunServerCommand = "Failed to the run the start server command. ExitCode={0}\nFilepath: {1}";
|
||||||
|
WarningVersionCheckException = "encountered exception when checking for new Hot Reload package version:\n{0}";
|
||||||
|
WarningVersionCheckFailed = "version check failed: {0}";
|
||||||
|
WarningUpdateIssueFailed = "Encountered issue when updating Hot Reload: {0}";
|
||||||
|
WarningUpdatePackageFailed = "Failed to update package: {0}";
|
||||||
|
WarningUnableToFindPackage = "Unable to find package. message: {0}";
|
||||||
|
WarningCompileCheckerIssue = "compile checker encountered issue: {0} {1}";
|
||||||
|
WarningFailedToStartServer = "Failed to start the Hot Reload Server. {0}";
|
||||||
|
WarningNoSlnFileFound = "No .sln file found. Open any c# file to generate it so Hot Reload can work properly";
|
||||||
|
WarningPreparingBuildInfoFailed = "Preparing build info failed! On-device functionality might not work. Exception: {0}";
|
||||||
|
WarningInlineMethodChecker = "Inline method checker ran into an exception. Please contact support with the exception message to investigate the problem. Exception: {0}";
|
||||||
|
WarningRefreshingAssetFailed = "Refreshing asset at path: {0} failed due to exception: {1}";
|
||||||
|
WarningFailedDeterminingRegistration = "Failed determining registration outcome with {0}: {1}";
|
||||||
|
WarningRedeemingLicenseFailed = "Redeeming a license failed with error: {0}";
|
||||||
|
WarningInitializingEventEntries = "Failed initializing Hot Reload event entries on start: {0}";
|
||||||
|
WarningPersistingEventEntries = "Failed persisting Hot Reload event entries: {0}";
|
||||||
|
WarningIndicationTextNotFound = "Indication text not found for status {0}";
|
||||||
|
|
||||||
|
// Info Messages
|
||||||
|
InfoDebuggerAttached = "Debugger was attached. Hot Reload may interfere with your debugger session. Recompiling in order to get full debugger experience.";
|
||||||
|
InfoInspectorFieldRecompile = "Some inspector field changes require recompilation in Unity. Auto recompiling Unity according to the settings.";
|
||||||
|
InfoDefaultProjectGeneration = "Using default project generation. If you encounter any problem with Unity's default project generation consider disabling it to use custom project generation.";
|
||||||
|
ErrorFreeChargesUnavailable = "Free charges unavailabe. Please contact support if the issue persists.";
|
||||||
|
|
||||||
|
// Exception Messages
|
||||||
|
ExceptionExpectedZipFile = "Expected to end with .zip, but it was: {0}";
|
||||||
|
ExceptionZipFileNotFound = "zip file not found {0}";
|
||||||
|
ExceptionUnzipFailed = "unzip failed with ExitCode {0}";
|
||||||
|
ExceptionDownloadFailed = "Download failed with status code {0} and reason {1}";
|
||||||
|
ExceptionUnableToFindManifest = "[{0}] Unable to find {1}";
|
||||||
|
ErrorRedeemRequestFailed = "Redeem request failed. Status code: {0}, reason: {1}";
|
||||||
|
ErrorFailedDeserializingRedeem = "Failed deserializing redeem response with exception: {0}: {1}";
|
||||||
|
ErrorRedeemingWebException = "Redeeming license failed: WebException encountered {0}";
|
||||||
|
ExceptionDownloadContentLengthUnknown = "Download failed: Content length unknown";
|
||||||
|
ExceptionDownloadFileCorrupted = "Download failed: download file is corrupted";
|
||||||
|
ExceptionFailedToFindAppDirectory = "Failed to find .app directory and move it to {0}";
|
||||||
|
ExceptionCouldNotStartCodePatcher = "Could not start code patcher process.";
|
||||||
|
|
||||||
|
// Info/Debug Messages
|
||||||
|
InfoManifestSearch = "Did not find {0} at {1}, searching for manifest file inside {2}";
|
||||||
|
InfoOmitProjectsForPlayerBuild = "To compile C# files same as a Player build, we must omit projects which aren't part of the selected Player build.";
|
||||||
|
InfoSeparator = "---------";
|
||||||
|
InfoOmittedEditorProject = "omitted editor/other project named: {0}";
|
||||||
|
InfoFoundProjectNamed = "found project named {0}";
|
||||||
|
|
||||||
|
// Project Generation Warnings
|
||||||
|
WarningPostProcessorException = "Post processor '{0}' threw exception when calling OnGeneratedCSProjectFilesThreaded:\n{1}";
|
||||||
|
WarningPostProcessorFailedProject = "Post processor '{0}' failed when processing project '{1}':\n{2}";
|
||||||
|
WarningPostProcessorFailedSolution = "Post processor '{0}' failed when processing solution '{1}':\n{2}";
|
||||||
|
WarningPostProcessorNoDefaultConstructor = "The type '{0}' was expected to have a public default constructor but it didn't";
|
||||||
|
WarningPostProcessorConstructorException = "Exception occurred when invoking default constructor of '{0}':\n{1}";
|
||||||
|
WarningPostProcessorUnknownException = "Unknown exception encountered when trying to create post processor '{0}':\n{1}";
|
||||||
|
|
||||||
|
// Parse Errors
|
||||||
|
ErrorParseError = "{0} Parse Error : {1}";
|
||||||
|
|
||||||
|
// Android Manifest Comments
|
||||||
|
CommentAndroidCleartextPermit = "[{0}] Added android:usesCleartextTraffic=\"true\" to permit connecting to the Hot Reload http server running on your machine.";
|
||||||
|
CommentAndroidCleartextDevelopmentOnly = "[{0}] This change only happens in Unity development builds. You can disable this in the Hot Reload settings window.";
|
||||||
|
|
||||||
|
// Debug Messages
|
||||||
|
DebugDetouringMethodFailed = "Detouring {0} method failed. {1} {2}";
|
||||||
|
|
||||||
|
// Package Update Errors
|
||||||
|
ErrorRequestFailedStatusCode = "Request failed with statusCode: {0} {1}";
|
||||||
|
ErrorInvalidPackageJson = "Invalid package.json";
|
||||||
|
ErrorInvalidVersionInPackageJson = "Invalid version in package.json: '{0}'";
|
||||||
|
ErrorUnableToFindManifestJson = "Unable to find manifest.json";
|
||||||
|
ErrorNoDependenciesInManifest = "no dependencies object found in manifest.json";
|
||||||
|
ErrorDependenciesNullInManifest = "dependencies object null in manifest.json";
|
||||||
|
ErrorNoDependenciesSpecified = "no dependencies specified in manifest.json";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Error Messages
|
||||||
|
ErrorInvalidInput = "无效输入";
|
||||||
|
ErrorNetworkIssue = "出现问题。请检查您的网络连接。";
|
||||||
|
ErrorContactSupport = "出现问题。如果问题仍然存在,请联系支持。";
|
||||||
|
ErrorDownloadFailed = "下载尝试失败。如果问题仍然存在,请联系客户支持寻求帮助。异常:{0}";
|
||||||
|
ErrorServerBinaryNotFound = "无法在“{1}”找到平台“{0}”的服务器二进制文件。将继续下载二进制文件(默认行为)";
|
||||||
|
ErrorCopyingServerBinary = "在指定的自定义可执行路径“{0}”中复制服务器二进制文件时遇到异常:\n{1}";
|
||||||
|
ErrorDownloadSucceeded = "下载成功!";
|
||||||
|
ErrorEnterNumber = "请输入一个数字。";
|
||||||
|
ErrorEnterEmail = "请输入您的电子邮件地址。";
|
||||||
|
ErrorValidEmail = "请输入有效的电子邮件地址。";
|
||||||
|
ErrorEnterPassword = "请输入您的密码。";
|
||||||
|
ErrorMailExtensions = "尚不支持邮件扩展(格式为'username+suffix@example.com')。请提供您原始的电子邮件地址(例如'username@example.com',不含'+suffix'部分),我们正在努力解决此问题。";
|
||||||
|
ErrorEnterInvoiceNumber = "请输入发票号码/订单 ID。";
|
||||||
|
ErrorInvalidEmailAddress = "请输入有效的电子邮件地址。";
|
||||||
|
ErrorLicenseInvoiceRedeemed = "您尝试使用的发票号码/订单 ID 已用于兑换许可证。请输入不同的发票号码/订单 ID。如果您已经为另一个电子邮件兑换了许可证,您可以继续下一步。";
|
||||||
|
ErrorEmailAlreadyUsed = "提供的电子邮件已用于兑换许可证。如果您之前已兑换许可证,您可以继续下一步并使用您现有的凭据。如果没有,请输入不同的电子邮件地址。";
|
||||||
|
ErrorInvoiceNotFound = "未找到发票。请确保您输入了正确的发票号码/订单 ID。";
|
||||||
|
ErrorInvoiceRefunded = "购买已退款。请输入不同的发票号码/订单 ID。";
|
||||||
|
ErrorPromoCodeInvalid = "您的促销代码无效。请确保您输入了正确的促销代码。";
|
||||||
|
ErrorPromoCodeUsed = "您的促销代码已被使用。";
|
||||||
|
ErrorPromoCodeExpired = "您的促销代码已过期。";
|
||||||
|
ErrorLicenseExtended = "您的许可证已使用促销代码激活。每个许可证只允许激活一次促销代码。";
|
||||||
|
ErrorPromoCodeActivation = "激活您的促销代码时遇到错误。请重试。如果问题仍然存在,请联系我们的客户支持团队寻求帮助。";
|
||||||
|
ErrorPromoCodeNetwork = "连接到我们的服务器时出现问题。请检查您的网络连接,如果问题仍然存在,请联系客户支持。";
|
||||||
|
|
||||||
|
// Warning Messages
|
||||||
|
WarningUnityJobHotReloaded = "一个 unity 作业被热重载。这将导致一个可以忽略的无害警告。更多信息可以在这里找到:{0}";
|
||||||
|
WarningBuildSettingsNotSupported = "由于一个或多个构建设置不受支持,Hot Reload 未包含在构建中。";
|
||||||
|
WarningInlinedMethods = "Unity 编辑器在“发布”模式下会内联简单方法,Hot Reload 无法修补。\n\n切换到调试模式以避免此问题,或让 Hot Reload 在出现此问题时完全重新编译 Unity。";
|
||||||
|
WarningMacOSVersionDetectionFailed = "检测 MacOS 版本失败,如果 Hot Reload 启动失败,请联系支持。";
|
||||||
|
WarningUnexpectedSaveProblem = "无法保存 HotReloadSettingsObject 的意外问题";
|
||||||
|
WarningRedeemStatusUnknown = "兑换许可证失败:收到未知状态";
|
||||||
|
WarningRedeemUnknownError = "兑换许可证失败:遇到未知错误";
|
||||||
|
WarningFailedToRunServerCommand = "运行启动服务器命令失败。退出代码={0}\n文件路径:{1}";
|
||||||
|
WarningVersionCheckException = "检查新的 Hot Reload 软件包版本时遇到异常:\n{0}";
|
||||||
|
WarningVersionCheckFailed = "版本检查失败:{0}";
|
||||||
|
WarningUpdateIssueFailed = "更新 Hot Reload 时遇到问题:{0}";
|
||||||
|
WarningUpdatePackageFailed = "更新软件包失败:{0}";
|
||||||
|
WarningUnableToFindPackage = "无法找到软件包。消息:{0}";
|
||||||
|
WarningCompileCheckerIssue = "编译检查器遇到问题:{0} {1}";
|
||||||
|
WarningFailedToStartServer = "启动 Hot Reload 服务器失败。{0}";
|
||||||
|
WarningNoSlnFileFound = "未找到 .sln 文件。打开任何 c# 文件以生成它,以便 Hot Reload 正常工作";
|
||||||
|
WarningPreparingBuildInfoFailed = "准备构建信息失败!设备上功能可能无法工作。异常:{0}";
|
||||||
|
WarningInlineMethodChecker = "内联方法检查器遇到异常。请联系支持并提供异常消息以调查问题。异常:{0}";
|
||||||
|
WarningRefreshingAssetFailed = "刷新路径:{0} 的资产失败,原因异常:{1}";
|
||||||
|
WarningFailedDeterminingRegistration = "确定注册结果失败,{0}:{1}";
|
||||||
|
WarningRedeemingLicenseFailed = "兑换许可证失败,错误:{0}";
|
||||||
|
WarningInitializingEventEntries = "启动时初始化 Hot Reload 事件条目失败:{0}";
|
||||||
|
WarningPersistingEventEntries = "持久化 Hot Reload 事件条目失败:{0}";
|
||||||
|
WarningIndicationTextNotFound = "未找到状态 {0} 的指示文本";
|
||||||
|
|
||||||
|
// Info Messages
|
||||||
|
InfoDebuggerAttached = "调试器已附加。Hot Reload 可能会干扰您的调试会话。正在重新编译以获得完整的调试器体验。";
|
||||||
|
InfoInspectorFieldRecompile = "一些检查器字段更改需要 Unity 重新编译。根据设置自动重新编译 Unity。";
|
||||||
|
InfoDefaultProjectGeneration = "使用默认项目生成。如果您遇到 Unity 默认项目生成的任何问题,请考虑禁用它以使用自定义项目生成。";
|
||||||
|
ErrorFreeChargesUnavailable = "免费费用不可用。如果问题仍然存在,请联系支持。";
|
||||||
|
|
||||||
|
// Exception Messages
|
||||||
|
ExceptionExpectedZipFile = "预期以 .zip 结尾,但它是:{0}";
|
||||||
|
ExceptionZipFileNotFound = "未找到 zip 文件 {0}";
|
||||||
|
ExceptionUnzipFailed = "解压缩失败,退出代码 {0}";
|
||||||
|
ExceptionDownloadFailed = "下载失败,状态码 {0},原因 {1}";
|
||||||
|
ExceptionUnableToFindManifest = "[{0}] 无法找到 {1}";
|
||||||
|
ErrorRedeemRequestFailed = "兑换请求失败。状态码:{0},原因:{1}";
|
||||||
|
ErrorFailedDeserializingRedeem = "反序列化兑换响应失败,异常:{0}:{1}";
|
||||||
|
ErrorRedeemingWebException = "兑换许可证失败:遇到 WebException {0}";
|
||||||
|
ExceptionDownloadContentLengthUnknown = "下载失败:内容长度未知";
|
||||||
|
ExceptionDownloadFileCorrupted = "下载失败:下载文件已损坏";
|
||||||
|
ExceptionFailedToFindAppDirectory = "未能找到 .app 目录并将其移动到 {0}";
|
||||||
|
ExceptionCouldNotStartCodePatcher = "无法启动代码修补程序进程。";
|
||||||
|
|
||||||
|
// Info/Debug Messages
|
||||||
|
InfoManifestSearch = "在 {1} 未找到 {0},正在 {2} 内搜索清单文件";
|
||||||
|
InfoOmitProjectsForPlayerBuild = "要像 Player 构建一样编译 C# 文件,我们必须省略不属于所选 Player 构建的项目。";
|
||||||
|
InfoSeparator = "---------";
|
||||||
|
InfoOmittedEditorProject = "省略的编辑器/其他项目名为:{0}";
|
||||||
|
InfoFoundProjectNamed = "找到名为 {0} 的项目";
|
||||||
|
|
||||||
|
// Project Generation Warnings
|
||||||
|
WarningPostProcessorException = "后处理器“{0}”在调用 OnGeneratedCSProjectFilesThreaded 时引发异常:\n{1}";
|
||||||
|
WarningPostProcessorFailedProject = "后处理器“{0}”在处理项目“{1}”时失败:\n{2}";
|
||||||
|
WarningPostProcessorFailedSolution = "后处理器“{0}”在处理解决方案“{1}”时失败:\n{2}";
|
||||||
|
WarningPostProcessorNoDefaultConstructor = "类型“{0}”应具有公共默认构造函数,但没有";
|
||||||
|
WarningPostProcessorConstructorException = "调用“{0}”的默认构造函数时发生异常:\n{1}";
|
||||||
|
WarningPostProcessorUnknownException = "尝试创建后处理器“{0}”时遇到未知异常:\n{1}";
|
||||||
|
|
||||||
|
// Parse Errors
|
||||||
|
ErrorParseError = "{0} 解析错误:{1}";
|
||||||
|
|
||||||
|
// Android Manifest Comments
|
||||||
|
CommentAndroidCleartextPermit = "[{0}] 添加了 android:usesCleartextTraffic=\"true\" 以允许连接到您机器上运行的 Hot Reload http 服务器。";
|
||||||
|
CommentAndroidCleartextDevelopmentOnly = "[{0}] 此更改仅在 Unity 开发构建中发生。您可以在 Hot Reload 设置窗口中禁用此功能。";
|
||||||
|
|
||||||
|
// Debug Messages
|
||||||
|
DebugDetouringMethodFailed = "Detouring {0} 方法失败。{1} {2}";
|
||||||
|
|
||||||
|
// Package Update Errors
|
||||||
|
ErrorRequestFailedStatusCode = "请求失败,状态码:{0} {1}";
|
||||||
|
ErrorInvalidPackageJson = "无效的 package.json";
|
||||||
|
ErrorInvalidVersionInPackageJson = "package.json 中的版本无效:'{0}'";
|
||||||
|
ErrorUnableToFindManifestJson = "无法找到 manifest.json";
|
||||||
|
ErrorNoDependenciesInManifest = "在 manifest.json 中找不到依赖项对象";
|
||||||
|
ErrorDependenciesNullInManifest = "manifest.json 中的依赖项对象为 null";
|
||||||
|
ErrorNoDependenciesSpecified = "manifest.json 中未指定依赖项";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f1ff9542af2fa0c4d8b9bfb9620e29a0
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class License {
|
||||||
|
// License & Authentication
|
||||||
|
public static string TitleHotReloadLimited;
|
||||||
|
public static string TitleHotReloadLicense;
|
||||||
|
public static string MessageTrialLicense;
|
||||||
|
public static string MessageIndieLicenseActive;
|
||||||
|
public static string MessageBusinessLicenseActive;
|
||||||
|
public static string MessageLicenseWillRenew;
|
||||||
|
public static string MessagePromoCodeActivated;
|
||||||
|
public static string PromoCodesTitle;
|
||||||
|
|
||||||
|
// License Error Descriptions
|
||||||
|
public static string LicenseErrorDeviceInUse;
|
||||||
|
public static string LicenseErrorDeviceBlacklisted;
|
||||||
|
public static string LicenseErrorIncorrectClock;
|
||||||
|
public static string LicenseErrorActivation;
|
||||||
|
public static string LicenseErrorDeleted;
|
||||||
|
public static string LicenseErrorDisabled;
|
||||||
|
public static string LicenseErrorExpired;
|
||||||
|
public static string LicenseErrorInactive;
|
||||||
|
public static string LicenseErrorCorrupted;
|
||||||
|
public static string LicenseErrorNetwork;
|
||||||
|
public static string LicenseErrorTrialExpired;
|
||||||
|
public static string LicenseErrorInvalidCredentials;
|
||||||
|
public static string LicenseErrorIncompatible;
|
||||||
|
public static string LicenseErrorDefault;
|
||||||
|
public static string LicenseErrorAssetStorePro;
|
||||||
|
public static string LicenseErrorUnityPlusIndie;
|
||||||
|
|
||||||
|
// License Button Labels
|
||||||
|
public static string LicenseButtonGetLicense;
|
||||||
|
public static string LicenseButtonContactSupport;
|
||||||
|
public static string LicenseButtonUpgradeLicense;
|
||||||
|
public static string LicenseButtonManageLicense;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// License & Authentication
|
||||||
|
TitleHotReloadLimited = "Hot Reload Limited";
|
||||||
|
TitleHotReloadLicense = "Hot Reload License";
|
||||||
|
MessageTrialLicense = "Using Trial license, valid until {0}";
|
||||||
|
MessageIndieLicenseActive = " Indie license active";
|
||||||
|
MessageBusinessLicenseActive = " Business license active";
|
||||||
|
MessageLicenseWillRenew = "License will renew on {0}.";
|
||||||
|
MessagePromoCodeActivated = "Your promo code has been successfully activated. Free trial has been extended by 3 months.";
|
||||||
|
PromoCodesTitle = "Promo Codes";
|
||||||
|
|
||||||
|
// License Error Descriptions
|
||||||
|
LicenseErrorDeviceInUse = "Another device is using your license. Please reach out to customer support for assistance.";
|
||||||
|
LicenseErrorDeviceBlacklisted = "You device has been blacklisted.";
|
||||||
|
LicenseErrorIncorrectClock = "Your license is not working because your computer's clock is incorrect. Please set the clock to the correct time to restore your license.";
|
||||||
|
LicenseErrorActivation = "An error has occured while activating your license. Please contact customer support for assistance.";
|
||||||
|
LicenseErrorDeleted = "Your license has been deleted. Please contact customer support for assistance.";
|
||||||
|
LicenseErrorDisabled = "Your license has been disabled. Please contact customer support for assistance.";
|
||||||
|
LicenseErrorExpired = "Your license has expired. Please renew your license subscription using the 'Upgrade License' button below and login with your email/password to activate your license.";
|
||||||
|
LicenseErrorInactive = "Your license is currenty inactive. Please login with your email/password to activate your license.";
|
||||||
|
LicenseErrorCorrupted = "Your license file was damaged or corrupted. Please login with your email/password to refresh your license file.";
|
||||||
|
LicenseErrorNetwork = "There is an issue connecting to our servers. Please check your internet connection or contact customer support if the issue persists.";
|
||||||
|
LicenseErrorTrialExpired = "Your trial has expired. Activate a license with unlimited usage or continue using the Free version. View available plans on our website.";
|
||||||
|
LicenseErrorInvalidCredentials = "Incorrect email/password. You can find your initial password in the sign-up email.";
|
||||||
|
LicenseErrorIncompatible = "Please upgrade your license to continue using hotreload with Unity Pro.";
|
||||||
|
LicenseErrorDefault = "We apologize, an error happened while verifying your license. Please reach out to customer support for assistance.";
|
||||||
|
LicenseErrorAssetStorePro = "Unity Pro/Enterprise users from company with your number of employees require a Business license. Please upgrade your license on our website.";
|
||||||
|
LicenseErrorUnityPlusIndie = "Unity Plus users require an Indie license. Please upgrade your license on our website.";
|
||||||
|
|
||||||
|
// License Button Labels
|
||||||
|
LicenseButtonGetLicense = "Get License";
|
||||||
|
LicenseButtonContactSupport = "Contact Support";
|
||||||
|
LicenseButtonUpgradeLicense = "Upgrade License";
|
||||||
|
LicenseButtonManageLicense = "Manage License";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// License & Authentication
|
||||||
|
TitleHotReloadLimited = "Hot Reload 有限";
|
||||||
|
TitleHotReloadLicense = "Hot Reload 许可证";
|
||||||
|
MessageTrialLicense = "正在使用试用许可证,有效期至 {0}";
|
||||||
|
MessageIndieLicenseActive = " 独立开发者许可证已激活";
|
||||||
|
MessageBusinessLicenseActive = " 商业许可证已激活";
|
||||||
|
MessageLicenseWillRenew = "许可证将于 {0} 续订。";
|
||||||
|
MessagePromoCodeActivated = "您的促销代码已成功激活。免费试用期已延长3个月。";
|
||||||
|
PromoCodesTitle = "促销代码";
|
||||||
|
|
||||||
|
// License Error Descriptions
|
||||||
|
LicenseErrorDeviceInUse = "另一台设备正在使用您的许可证。请联系客户支持寻求帮助。";
|
||||||
|
LicenseErrorDeviceBlacklisted = "您的设备已被列入黑名单。";
|
||||||
|
LicenseErrorIncorrectClock = "您的许可证无法工作,因为您的计算机时钟不正确。请将时钟设置为正确的时间以恢复您的许可证。";
|
||||||
|
LicenseErrorActivation = "激活您的许可证时发生错误。请联系客户支持寻求帮助。";
|
||||||
|
LicenseErrorDeleted = "您的许可证已被删除。请联系客户支持寻求帮助。";
|
||||||
|
LicenseErrorDisabled = "您的许可证已被禁用。请联系客户支持寻求帮助。";
|
||||||
|
LicenseErrorExpired = "您的许可证已过期。请使用下方的“升级许可证”按钮续订您的许可证订阅,并使用您的电子邮件/密码登录以激活您的许可证。";
|
||||||
|
LicenseErrorInactive = "您的许可证当前未激活。请使用您的电子邮件/密码登录以激活您的许可证。";
|
||||||
|
LicenseErrorCorrupted = "您的许可证文件已损坏或损坏。请使用您的电子邮件/密码登录以刷新您的许可证文件。";
|
||||||
|
LicenseErrorNetwork = "连接到我们的服务器时出现问题。请检查您的网络连接,如果问题仍然存在,请联系客户支持。";
|
||||||
|
LicenseErrorTrialExpired = "您的试用已过期。激活具有无限使用权的许可证或继续使用免费版本。在我们网站上查看可用计划。";
|
||||||
|
LicenseErrorInvalidCredentials = "电子邮件/密码不正确。您可以在注册电子邮件中找到您的初始密码。";
|
||||||
|
LicenseErrorIncompatible = "请升级您的许可证以继续在 Unity Pro 中使用 hotreload。";
|
||||||
|
LicenseErrorDefault = "我们深表歉意,验证您的许可证时发生错误。请联系客户支持寻求帮助。";
|
||||||
|
LicenseErrorAssetStorePro = "拥有您员工数量的公司中的 Unity Pro/Enterprise 用户需要商业许可证。请在我们的网站上升级您的许可证。";
|
||||||
|
LicenseErrorUnityPlusIndie = "Unity Plus 用户需要独立开发者许可证。请在我们的网站上升级您的许可证。";
|
||||||
|
|
||||||
|
// License Button Labels
|
||||||
|
LicenseButtonGetLicense = "获取许可证";
|
||||||
|
LicenseButtonContactSupport = "联系支持";
|
||||||
|
LicenseButtonUpgradeLicense = "升级许可证";
|
||||||
|
LicenseButtonManageLicense = "管理许可证";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 35d12621e71ef12458b3bbe48e047469
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
[InitializeOnLoad]
|
||||||
|
internal static partial class Translations {
|
||||||
|
static string loadedLocale;
|
||||||
|
static Translations() {
|
||||||
|
LoadDefaultLocalization();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadDefaultLocalization() {
|
||||||
|
LoadLocalization(PackageConst.DefaultLocale);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void LoadLocalization(string locale) {
|
||||||
|
if (loadedLocale == locale) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (locale == Locale.SimplifiedChinese) {
|
||||||
|
LoadSimplifiedChinese();
|
||||||
|
} else {
|
||||||
|
LoadEnglish();
|
||||||
|
}
|
||||||
|
loadedLocale = locale;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void LoadEnglish() {
|
||||||
|
Common.LoadEnglish();
|
||||||
|
Timeline.LoadEnglish();
|
||||||
|
License.LoadEnglish();
|
||||||
|
Errors.LoadEnglish();
|
||||||
|
Registration.LoadEnglish();
|
||||||
|
Dialogs.LoadEnglish();
|
||||||
|
Settings.LoadEnglish();
|
||||||
|
OnDevice.LoadEnglish();
|
||||||
|
About.LoadEnglish();
|
||||||
|
Miscellaneous.LoadEnglish();
|
||||||
|
Suggestions.LoadEnglish();
|
||||||
|
Utility.LoadEnglish();
|
||||||
|
UI.LoadEnglish();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void LoadSimplifiedChinese() {
|
||||||
|
Common.LoadSimplifiedChinese();
|
||||||
|
Timeline.LoadSimplifiedChinese();
|
||||||
|
License.LoadSimplifiedChinese();
|
||||||
|
Errors.LoadSimplifiedChinese();
|
||||||
|
Registration.LoadSimplifiedChinese();
|
||||||
|
Dialogs.LoadSimplifiedChinese();
|
||||||
|
Settings.LoadSimplifiedChinese();
|
||||||
|
OnDevice.LoadSimplifiedChinese();
|
||||||
|
About.LoadSimplifiedChinese();
|
||||||
|
Miscellaneous.LoadSimplifiedChinese();
|
||||||
|
Suggestions.LoadSimplifiedChinese();
|
||||||
|
Utility.LoadSimplifiedChinese();
|
||||||
|
UI.LoadSimplifiedChinese();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1e39c1f768bb465fa48c1fe2c3dd4d75
|
||||||
|
timeCreated: 1759652321
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
|
|
||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class MenuItems {
|
||||||
|
public const string OpenHotReload = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "Window/Hot Reload/打开 &#H" : "Window/Hot Reload/Open &#H";
|
||||||
|
public const string RecompileHotReload = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "Window/Hot Reload/重新编译" : "Window/Hot Reload/Recompile";
|
||||||
|
public const string OverlayDescription = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "Hot Reload" : "Hot Reload";
|
||||||
|
public const string NotImplementedObsolete = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "未实现" : "Not implemented";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ff31c47e148cfc243a9f2c173a058c3f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Miscellaneous {
|
||||||
|
// Overlay/Toolbar
|
||||||
|
public static string OverlayTooltipRecompile;
|
||||||
|
|
||||||
|
// Notifications
|
||||||
|
public static string NotificationPatching;
|
||||||
|
public static string NotificationNeedsRecompile;
|
||||||
|
|
||||||
|
// Update Button
|
||||||
|
public static string ButtonUpdateToVersionFormat;
|
||||||
|
public static string ButtonTroubleshooting;
|
||||||
|
|
||||||
|
// Rate App
|
||||||
|
public static string RateAppQuestion;
|
||||||
|
public static string RateAppThankYou;
|
||||||
|
|
||||||
|
// Compilation Messages
|
||||||
|
public static string CompileErrorTapToSee;
|
||||||
|
public static string UnsupportedChangeTapToSee;
|
||||||
|
public static string TapToShowStacktrace;
|
||||||
|
|
||||||
|
// Link Messages
|
||||||
|
public static string LinkForgotPassword;
|
||||||
|
|
||||||
|
// Changelog
|
||||||
|
public static string ChangelogTitle;
|
||||||
|
|
||||||
|
// Daily Session
|
||||||
|
public static string DailySessionStart;
|
||||||
|
public static string DailySessionTimeHoursLeft;
|
||||||
|
public static string DailySessionTimeMinutesLeft;
|
||||||
|
public static string DailySessionNextSessionMinutes;
|
||||||
|
public static string DailySessionNextSessionHours;
|
||||||
|
|
||||||
|
// Indication Status Messages
|
||||||
|
public static string IndicationFinishRegistration;
|
||||||
|
public static string IndicationStarted;
|
||||||
|
public static string IndicationStopping;
|
||||||
|
public static string IndicationStopped;
|
||||||
|
public static string IndicationPaused;
|
||||||
|
public static string IndicationInstalling;
|
||||||
|
public static string IndicationStarting;
|
||||||
|
public static string IndicationReloaded;
|
||||||
|
public static string IndicationPartiallySupported;
|
||||||
|
public static string IndicationUnsupported;
|
||||||
|
public static string IndicationPatching;
|
||||||
|
public static string IndicationCompiling;
|
||||||
|
public static string IndicationCompileErrors;
|
||||||
|
public static string IndicationActivationFailed;
|
||||||
|
public static string IndicationLoading;
|
||||||
|
public static string IndicationUndetected;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Overlay/Toolbar
|
||||||
|
OverlayTooltipRecompile = "Recompile";
|
||||||
|
|
||||||
|
// Notifications
|
||||||
|
NotificationPatching = "[Hot Reload] Applying patches...";
|
||||||
|
NotificationNeedsRecompile = "[Hot Reload] Unsupported Changes detected! Recompiling...";
|
||||||
|
|
||||||
|
// Update Button
|
||||||
|
ButtonUpdateToVersionFormat = "Update To v{0}";
|
||||||
|
ButtonTroubleshooting = "Troubleshooting";
|
||||||
|
|
||||||
|
// Rate App
|
||||||
|
RateAppQuestion = "Are you enjoying using Hot Reload?";
|
||||||
|
RateAppThankYou = "Thank you for using Hot Reload!\n\nPlease consider leaving a review on the Asset Store to support us.";
|
||||||
|
|
||||||
|
// Compilation Messages
|
||||||
|
CompileErrorTapToSee = "Compile error, tap here to see more.";
|
||||||
|
UnsupportedChangeTapToSee = "Unsupported change detected, tap here to see more.";
|
||||||
|
TapToShowStacktrace = "Tap to show stacktrace";
|
||||||
|
|
||||||
|
// Link Messages
|
||||||
|
LinkForgotPassword = "Forgot password?";
|
||||||
|
|
||||||
|
// Changelog
|
||||||
|
ChangelogTitle = "Changelog";
|
||||||
|
|
||||||
|
// Daily Session
|
||||||
|
DailySessionStart = "Daily Session: Make code changes to start";
|
||||||
|
DailySessionTimeHoursLeft = "Daily Session: {0}h {1}m Left";
|
||||||
|
DailySessionTimeMinutesLeft = "Daily Session: {1}m Left";
|
||||||
|
DailySessionNextSessionMinutes = "Next Session: {1}m";
|
||||||
|
DailySessionNextSessionHours = "Next Session: {0}h {1}m";
|
||||||
|
|
||||||
|
// Indication Status Messages
|
||||||
|
IndicationFinishRegistration = "Finish Registration";
|
||||||
|
IndicationStarted = "Waiting for code changes";
|
||||||
|
IndicationStopping = "Stopping Hot Reload";
|
||||||
|
IndicationStopped = "Hot Reload inactive";
|
||||||
|
IndicationPaused = "Hot Reload paused";
|
||||||
|
IndicationInstalling = "Installing";
|
||||||
|
IndicationStarting = "Starting Hot Reload";
|
||||||
|
IndicationReloaded = "Reload finished";
|
||||||
|
IndicationPartiallySupported = "Changes partially applied";
|
||||||
|
IndicationUnsupported = "Finished with warnings";
|
||||||
|
IndicationPatching = "Reloading";
|
||||||
|
IndicationCompiling = "Compiling";
|
||||||
|
IndicationCompileErrors = "Scripts have compile errors";
|
||||||
|
IndicationActivationFailed = "Activation failed";
|
||||||
|
IndicationLoading = "Loading";
|
||||||
|
IndicationUndetected = "No changes applied";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Overlay/Toolbar
|
||||||
|
OverlayTooltipRecompile = "重新编译";
|
||||||
|
|
||||||
|
// Notifications
|
||||||
|
NotificationPatching = "[Hot Reload] 正在应用补丁...";
|
||||||
|
NotificationNeedsRecompile = "[Hot Reload] 检测到不支持的更改!正在重新编译...";
|
||||||
|
|
||||||
|
// Update Button
|
||||||
|
ButtonUpdateToVersionFormat = "更新到 v{0}";
|
||||||
|
ButtonTroubleshooting = "疑难解答";
|
||||||
|
|
||||||
|
// Rate App
|
||||||
|
RateAppQuestion = "您喜欢使用 Hot Reload 吗?";
|
||||||
|
RateAppThankYou = "感谢您使用 Hot Reload!\n\n请考虑在 Asset Store 上留下评论以支持我们。";
|
||||||
|
|
||||||
|
// Compilation Messages
|
||||||
|
CompileErrorTapToSee = "编译错误,点击此处查看更多。";
|
||||||
|
UnsupportedChangeTapToSee = "检测到不支持的更改,点击此处查看更多。";
|
||||||
|
TapToShowStacktrace = "点击以显示堆栈跟踪";
|
||||||
|
|
||||||
|
// Link Messages
|
||||||
|
LinkForgotPassword = "忘记密码?";
|
||||||
|
|
||||||
|
// Changelog
|
||||||
|
ChangelogTitle = "更新日志";
|
||||||
|
|
||||||
|
// Daily Session
|
||||||
|
DailySessionStart = "每日会话:进行代码更改以开始";
|
||||||
|
DailySessionTimeHoursLeft = "每日会话:剩余 {0}h {1}m";
|
||||||
|
DailySessionTimeMinutesLeft = "每日会话:剩余 {1}m";
|
||||||
|
DailySessionNextSessionMinutes = "下一会话:{1}m";
|
||||||
|
DailySessionNextSessionHours = "下一会话:{0}h {1}m";
|
||||||
|
|
||||||
|
// Indication Status Messages
|
||||||
|
IndicationFinishRegistration = "完成注册";
|
||||||
|
IndicationStarted = "等待代码更改";
|
||||||
|
IndicationStopping = "正在停止 Hot Reload";
|
||||||
|
IndicationStopped = "Hot Reload 未激活";
|
||||||
|
IndicationPaused = "Hot Reload 已暂停";
|
||||||
|
IndicationInstalling = "正在安装";
|
||||||
|
IndicationStarting = "正在启动 Hot Reload";
|
||||||
|
IndicationReloaded = "重新加载完成";
|
||||||
|
IndicationPartiallySupported = "更改部分应用";
|
||||||
|
IndicationUnsupported = "完成但有警告";
|
||||||
|
IndicationPatching = "正在重新加载";
|
||||||
|
IndicationCompiling = "正在编译";
|
||||||
|
IndicationCompileErrors = "脚本有编译错误";
|
||||||
|
IndicationActivationFailed = "激活失败";
|
||||||
|
IndicationLoading = "正在加载";
|
||||||
|
IndicationUndetected = "未应用任何更改";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 839cc9c3fc3098d478a7450b4d23b907
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class OnDevice {
|
||||||
|
// On-Device Settings
|
||||||
|
public static string OnDeviceHeadline;
|
||||||
|
public static string OnDeviceManualConnectFormat;
|
||||||
|
public static string OnDeviceManualConnectWithIP;
|
||||||
|
public static string OnDeviceNetworkNote;
|
||||||
|
public static string OnDeviceCheckHotReloadRunning;
|
||||||
|
public static string OnDeviceCheckHotReloadNotRunning;
|
||||||
|
public static string OnDeviceCheckEnableExposeServer;
|
||||||
|
public static string OnDeviceCheckPlatformSelected;
|
||||||
|
public static string OnDeviceCheckPlatformNotSupported;
|
||||||
|
public static string OnDeviceCheckDevelopmentEnabled;
|
||||||
|
public static string OnDeviceCheckEnableDevelopment;
|
||||||
|
public static string OnDeviceCheckMonoBackend;
|
||||||
|
public static string OnDeviceCheckSetMonoBackend;
|
||||||
|
public static string OnDeviceCheckStrippingLevel;
|
||||||
|
public static string OnDeviceCheckStrippingSolution;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// On-Device Settings
|
||||||
|
OnDeviceHeadline = "Make changes to a build running on-device";
|
||||||
|
OnDeviceManualConnectFormat = "If auto-pair fails, find your local IP in OS settings, and use this format to connect: '{ip}:{0}'";
|
||||||
|
OnDeviceManualConnectWithIP = "If auto-pair fails, use this IP and port to connect: {0}:{1}\nMake sure you are on the same LAN/WiFi network";
|
||||||
|
OnDeviceNetworkNote = "Make sure you are on the same LAN/WiFi network";
|
||||||
|
OnDeviceCheckHotReloadRunning = "Hot Reload is running";
|
||||||
|
OnDeviceCheckHotReloadNotRunning = "Hot Reload is not running";
|
||||||
|
OnDeviceCheckEnableExposeServer = "Enable '{0}'";
|
||||||
|
OnDeviceCheckPlatformSelected = "The {0} platform is selected";
|
||||||
|
OnDeviceCheckPlatformNotSupported = "The current platform is {0} which is not supported";
|
||||||
|
OnDeviceCheckDevelopmentEnabled = "Development Build is enabled";
|
||||||
|
OnDeviceCheckEnableDevelopment = "Enable \"Development Build\"";
|
||||||
|
OnDeviceCheckMonoBackend = "Scripting Backend is set to Mono";
|
||||||
|
OnDeviceCheckSetMonoBackend = "Set Scripting Backend to Mono";
|
||||||
|
OnDeviceCheckStrippingLevel = "Stripping Level = {0}";
|
||||||
|
OnDeviceCheckStrippingSolution = "Code stripping needs to be disabled to ensure that all methods are available for patching.";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// On-Device Settings
|
||||||
|
OnDeviceHeadline = "对在设备上运行的构建进行更改";
|
||||||
|
OnDeviceManualConnectFormat = "如果自动配对失败,请在操作系统设置中找到您的本地 IP,并使用此格式进行连接:'{ip}:{0}'";
|
||||||
|
OnDeviceManualConnectWithIP = "如果自动配对失败,请使用此 IP 和端口进行连接:{0}:{1}\n确保您在同一个局域网/WiFi 网络中";
|
||||||
|
OnDeviceNetworkNote = "确保您在同一个局域网/WiFi 网络中";
|
||||||
|
OnDeviceCheckHotReloadRunning = "Hot Reload 正在运行";
|
||||||
|
OnDeviceCheckHotReloadNotRunning = "Hot Reload 未运行";
|
||||||
|
OnDeviceCheckEnableExposeServer = "启用 '{0}'";
|
||||||
|
OnDeviceCheckPlatformSelected = "已选择 {0} 平台";
|
||||||
|
OnDeviceCheckPlatformNotSupported = "当前平台为 {0},不支持";
|
||||||
|
OnDeviceCheckDevelopmentEnabled = "开发构建已启用";
|
||||||
|
OnDeviceCheckEnableDevelopment = "启用“开发构建”";
|
||||||
|
OnDeviceCheckMonoBackend = "脚本后端设置为 Mono";
|
||||||
|
OnDeviceCheckSetMonoBackend = "将脚本后端设置为 Mono";
|
||||||
|
OnDeviceCheckStrippingLevel = "剥离级别 = {0}";
|
||||||
|
OnDeviceCheckStrippingSolution = "需要禁用代码剥离以确保所有方法都可用于修补。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 19a8c5bfa6576844d9789872adce14e1
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Registration {
|
||||||
|
// Registration & Redeem
|
||||||
|
public static string MessageRegistrationProUsers;
|
||||||
|
public static string MessageRegistrationLicensingModel;
|
||||||
|
public static string MessageRedeemInstructions;
|
||||||
|
public static string MessageRedeemSuccess;
|
||||||
|
public static string MessageRedeemAlreadyClaimed;
|
||||||
|
public static string UnknownRedeemError;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Registration & Redeem
|
||||||
|
MessageRegistrationProUsers = "Unity Pro users are required to obtain an additional license. You are eligible to redeem one if your company has ten or fewer employees. Please enter your company details below.";
|
||||||
|
MessageRegistrationLicensingModel = "The licensing model for Unity Pro users varies depending on the number of employees in your company. Please enter your company details below.";
|
||||||
|
MessageRedeemInstructions = "To enable us to verify your purchase, please enter your invoice number/order ID. Additionally, provide the email address that you intend to use for managing your credentials.";
|
||||||
|
MessageRedeemSuccess = "Success! You will receive an email containing your license password shortly. Once you receive it, please enter the received password in the designated field below to complete your registration.";
|
||||||
|
MessageRedeemAlreadyClaimed = "Your license has already been redeemed. Please enter your existing password below.";
|
||||||
|
UnknownRedeemError = "We apologize, an error happened while redeeming your license. Please reach out to customer support for assistance.";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Registration & Redeem
|
||||||
|
MessageRegistrationProUsers = "Unity Pro 用户需要获得额外许可证。如果您的公司有十名或更少员工,您有资格兑换一个。请在下方输入您的公司详细信息。";
|
||||||
|
MessageRegistrationLicensingModel = "Unity Pro 用户的许可模式因公司员工人数而异。请在下方输入您的公司详细信息。";
|
||||||
|
MessageRedeemInstructions = "为使我们能够验证您的购买,请输入您的发票号码/订单 ID。此外,请提供您打算用于管理凭据的电子邮件地址。";
|
||||||
|
MessageRedeemSuccess = "成功!您很快将收到一封包含许可证密码的电子邮件。收到后,请在下方指定字段中输入收到的密码以完成注册。";
|
||||||
|
MessageRedeemAlreadyClaimed = "您的许可证已被兑换。请在下方输入您现有的密码。";
|
||||||
|
UnknownRedeemError = "我们深表歉意,兑换您的许可证时发生错误。请联系客户支持寻求帮助。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: da7def2f6c8576e4bbb04a79c3438b46
|
||||||
@@ -0,0 +1,274 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Settings {
|
||||||
|
// Settings Tab
|
||||||
|
public static string SettingsTitle;
|
||||||
|
public static string SettingsConfiguration;
|
||||||
|
public static string SettingsAdvanced;
|
||||||
|
public static string SettingsOnDevice;
|
||||||
|
public static string SettingsManualConnect;
|
||||||
|
public static string SettingsBuildSettingsChecklist;
|
||||||
|
public static string SettingsOptions;
|
||||||
|
public static string SettingsVisualFeedback;
|
||||||
|
public static string SettingsMisc;
|
||||||
|
|
||||||
|
// Settings Descriptions
|
||||||
|
public static string SettingsManageAutoRefreshOn;
|
||||||
|
public static string SettingsManageAutoRefreshOff;
|
||||||
|
public static string SettingsAssetRefreshOn;
|
||||||
|
public static string SettingsAssetRefreshOff;
|
||||||
|
public static string SettingsDebuggerCompatibilityOn;
|
||||||
|
public static string SettingsDebuggerCompatibilityOff;
|
||||||
|
public static string SettingsRefreshShadersOn;
|
||||||
|
public static string SettingsRefreshShadersOff;
|
||||||
|
public static string SettingsHideConsoleOn;
|
||||||
|
public static string SettingsHideConsoleOff;
|
||||||
|
public static string SettingsDeactivatedOn;
|
||||||
|
public static string SettingsDeactivatedOff;
|
||||||
|
public static string SettingsDisableErrorReportingOn;
|
||||||
|
public static string SettingsDisableErrorReportingOff;
|
||||||
|
public static string SettingsPauseEditModeOn;
|
||||||
|
public static string SettingsPauseEditModeOff;
|
||||||
|
public static string SettingsAutostartOn;
|
||||||
|
public static string SettingsAutostartOff;
|
||||||
|
public static string SettingsPatchingIndicationUnsupported;
|
||||||
|
public static string SettingsPatchingIndicationOff;
|
||||||
|
public static string SettingsPatchingIndicationOn;
|
||||||
|
public static string SettingsCompilingIndicationUnsupported;
|
||||||
|
public static string SettingsCompilingIndicationOff;
|
||||||
|
public static string SettingsCompilingIndicationOn;
|
||||||
|
public static string SettingsAutoRecompileUnsupported;
|
||||||
|
public static string SettingsAutoRecompileOn;
|
||||||
|
public static string SettingsAutoRecompileOff;
|
||||||
|
public static string SettingsAutoRecompileInspectorOn;
|
||||||
|
public static string SettingsAutoRecompileInspectorOff;
|
||||||
|
public static string SettingsAutoRecompilePartialOn;
|
||||||
|
public static string SettingsAutoRecompilePartialOff;
|
||||||
|
public static string SettingsDisplayMonobehaviourOn;
|
||||||
|
public static string SettingsDisplayMonobehaviourOff;
|
||||||
|
public static string SettingsRecompileImmediatelyOn;
|
||||||
|
public static string SettingsRecompileImmediatelyOff;
|
||||||
|
public static string SettingsRecompilePlayModeOn;
|
||||||
|
public static string SettingsRecompilePlayModeOff;
|
||||||
|
public static string SettingsRecompileEditModeOn;
|
||||||
|
public static string SettingsRecompileEditModeOff;
|
||||||
|
public static string SettingsRecompileExitPlayModeOn;
|
||||||
|
public static string SettingsRecompileExitPlayModeOff;
|
||||||
|
public static string SettingsIndicationsUnsupported;
|
||||||
|
|
||||||
|
// Settings Toggle Names
|
||||||
|
public static string ToggleManageAutoRefresh;
|
||||||
|
public static string ToggleAssetRefresh;
|
||||||
|
public static string ToggleDebuggerCompatibility;
|
||||||
|
public static string ToggleRefreshShaders;
|
||||||
|
public static string ToggleHideConsole;
|
||||||
|
public static string ToggleDeactivate;
|
||||||
|
public static string ToggleDisableErrorReporting;
|
||||||
|
public static string TogglePauseEditMode;
|
||||||
|
public static string ToggleAutostart;
|
||||||
|
public static string TogglePatchingIndication;
|
||||||
|
public static string ToggleCompilingIndication;
|
||||||
|
public static string ToggleAutoRecompile;
|
||||||
|
public static string ToggleAutoRecompileInspector;
|
||||||
|
public static string ToggleAutoRecompilePartial;
|
||||||
|
public static string ToggleDisplayMonobehaviour;
|
||||||
|
public static string ToggleRecompileImmediately;
|
||||||
|
public static string ToggleRecompilePlayMode;
|
||||||
|
public static string ToggleRecompileEditMode;
|
||||||
|
public static string ToggleRecompileExitPlayMode;
|
||||||
|
|
||||||
|
// Settings Options
|
||||||
|
public static string OptionExposeServerShort;
|
||||||
|
public static string OptionExposeServerFull;
|
||||||
|
public static string OptionExposeServerDescriptionEnabled;
|
||||||
|
public static string OptionExposeServerDescriptionDisabled;
|
||||||
|
public static string OptionAllowHttpRequests;
|
||||||
|
public static string OptionAllowHttpRequestsDescription;
|
||||||
|
public static string OptionIncludeInBuild;
|
||||||
|
public static string OptionIncludeInBuildDescriptionEnabled;
|
||||||
|
public static string OptionIncludeInBuildDescriptionDisabled;
|
||||||
|
public static string OptionIncludeInBuildDescriptionSuffix;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Settings Tab
|
||||||
|
SettingsTitle = "Settings";
|
||||||
|
SettingsConfiguration = "Settings";
|
||||||
|
SettingsAdvanced = "Advanced";
|
||||||
|
SettingsOnDevice = "On-Device";
|
||||||
|
SettingsManualConnect = "Manual connect";
|
||||||
|
SettingsBuildSettingsChecklist = "Build Settings Checklist";
|
||||||
|
SettingsOptions = "Options";
|
||||||
|
SettingsVisualFeedback = "Visual Feedback";
|
||||||
|
SettingsMisc = "Misc";
|
||||||
|
|
||||||
|
// Settings Descriptions
|
||||||
|
SettingsManageAutoRefreshOn = "To avoid unnecessary recompiling, Hot Reload will automatically change Unity's Auto Refresh and Script Compilation settings. Previous settings will be restored when Hot Reload is stopped";
|
||||||
|
SettingsManageAutoRefreshOff = "Enabled this setting to auto-manage Unity's Auto Refresh and Script Compilation settings. This reduces unncessary recompiling";
|
||||||
|
SettingsAssetRefreshOn = "Hot Reload will refresh changed assets such as sprites, prefabs, etc";
|
||||||
|
SettingsAssetRefreshOff = "Enable to allow Hot Reload to refresh changed assets in the project. All asset types are supported including sprites, prefabs, shaders etc";
|
||||||
|
SettingsDebuggerCompatibilityOn = "Hot Reload automatically disables itself while a debugger is attached, as it can otherwise interfere with certain debugger features. Please read the documentation if you consider disabling this setting.";
|
||||||
|
SettingsDebuggerCompatibilityOff = "When a debugger is attached, Hot Reload will be active, but certain debugger features might not work as expected. Please read our documentation to learn about the limitations.";
|
||||||
|
SettingsRefreshShadersOn = "Hot Reload will auto refresh shaders. Note that enabling this setting might impact performance.";
|
||||||
|
SettingsRefreshShadersOff = "Enable to auto-refresh shaders. Note that enabling this setting might impact performance";
|
||||||
|
SettingsHideConsoleOn = "Hot Reload will start without creating a console window. Logs can be accessed through \"Help\" tab.";
|
||||||
|
SettingsHideConsoleOff = "Enable to start Hot Reload without creating a console window.";
|
||||||
|
SettingsDeactivatedOn = "Hot Reload is deactivated.";
|
||||||
|
SettingsDeactivatedOff = "Enable to deactivate Hot Reload.";
|
||||||
|
SettingsDisableErrorReportingOn = "Detailed error reporting is disabled.";
|
||||||
|
SettingsDisableErrorReportingOff = "Toggle on to disable detailed error reporting.";
|
||||||
|
SettingsPauseEditModeOn = "Hot Reload is paused in Edit mode. It is recommended to perform a full Unity recompilation manually before entering Play Mode to prevent Hot Reload becoming unusable.";
|
||||||
|
SettingsPauseEditModeOff = "Toggle on to pause Hot Reload while in Edit mode. With this setting enabled, it is recommended to perform a full Unity recompilation manually before entering Play Mode to prevent Hot Reload becoming unusable.";
|
||||||
|
SettingsAutostartOn = "Hot Reload will be launched when Unity project opens.";
|
||||||
|
SettingsAutostartOff = "Enable to launch Hot Reload when Unity project opens.";
|
||||||
|
SettingsPatchingIndicationUnsupported = "Patching Notification is not supported in the Unity version you use.";
|
||||||
|
SettingsPatchingIndicationOff = "Enable to show GameView and SceneView indications when Patching.";
|
||||||
|
SettingsPatchingIndicationOn = "Indications will be shown in GameView and SceneView when Patching.";
|
||||||
|
SettingsCompilingIndicationUnsupported = "Compiling Unsupported Changes Notification is not supported in the Unity version you use.";
|
||||||
|
SettingsCompilingIndicationOff = "Enable to show GameView and SceneView indications when compiling unsupported changes.";
|
||||||
|
SettingsCompilingIndicationOn = "Indications will be shown in GameView and SceneView when compiling unsupported changes.";
|
||||||
|
SettingsAutoRecompileUnsupported = "Auto recompiling unsupported changes is not supported in the Unity version you use.";
|
||||||
|
SettingsAutoRecompileOn = "Hot Reload will recompile automatically after code changes that Hot Reload doesn't support.";
|
||||||
|
SettingsAutoRecompileOff = "When enabled, recompile happens automatically after code changes that Hot Reload doesn't support.";
|
||||||
|
SettingsAutoRecompileInspectorOn = "Hot Reload will trigger recompilation for inspector field changes that are not supported in Edit mode.";
|
||||||
|
SettingsAutoRecompileInspectorOff = "Enable to trigger recompilation for inspector field changes that are not supported in Edit mode.";
|
||||||
|
SettingsAutoRecompilePartialOn = "Hot Reload will recompile partially unsupported changes.";
|
||||||
|
SettingsAutoRecompilePartialOff = "Enable to recompile partially unsupported changes.";
|
||||||
|
SettingsDisplayMonobehaviourOn = "Hot Reload will display new monobehaviour methods as partially unsupported.";
|
||||||
|
SettingsDisplayMonobehaviourOff = "Enable to display new monobehaviour methods as partially unsupported.";
|
||||||
|
SettingsRecompileImmediatelyOn = "Unsupported changes will be recompiled immediately.";
|
||||||
|
SettingsRecompileImmediatelyOff = "Unsupported changes will be recompiled when editor is focused. Enable to recompile immediately.";
|
||||||
|
SettingsRecompilePlayModeOn = "Hot Reload will exit Play Mode to recompile unsupported changes.";
|
||||||
|
SettingsRecompilePlayModeOff = "Enable to auto exit Play Mode to recompile unsupported changes.";
|
||||||
|
SettingsRecompileEditModeOn = "Hot Reload recompile unsupported changes when in Edit Mode.";
|
||||||
|
SettingsRecompileEditModeOff = "Enable to auto recompile unsupported changes in Edit Mode.";
|
||||||
|
SettingsRecompileExitPlayModeOn = "Hot Reload will recompile unsupported changes when exiting Play Mode.";
|
||||||
|
SettingsRecompileExitPlayModeOff = "Enable to recompile unsupported changes when exiting Play Mode.";
|
||||||
|
SettingsIndicationsUnsupported = "Indications are not supported in the Unity version you use.";
|
||||||
|
|
||||||
|
// Settings Toggle Names
|
||||||
|
ToggleManageAutoRefresh = "Manage Unity auto-refresh (recommended)";
|
||||||
|
ToggleAssetRefresh = "Asset refresh (recommended)";
|
||||||
|
ToggleDebuggerCompatibility = "Auto-disable Hot Reload while a debugger is attached (recommended)";
|
||||||
|
ToggleRefreshShaders = "Refresh shaders";
|
||||||
|
ToggleHideConsole = "Hide console window on start";
|
||||||
|
ToggleDeactivate = "Deactivate Hot Reload";
|
||||||
|
ToggleDisableErrorReporting = "Disable Detailed Error Reporting";
|
||||||
|
TogglePauseEditMode = "Pause Hot Reload in Edit Mode";
|
||||||
|
ToggleAutostart = "Autostart on Unity open";
|
||||||
|
TogglePatchingIndication = "Patching Indication";
|
||||||
|
ToggleCompilingIndication = "Compiling Unsupported Changes Indication";
|
||||||
|
ToggleAutoRecompile = "Auto recompile unsupported changes (recommended)";
|
||||||
|
ToggleAutoRecompileInspector = "Auto recompile inspector field edits";
|
||||||
|
ToggleAutoRecompilePartial = "Include partially unsupported changes";
|
||||||
|
ToggleDisplayMonobehaviour = "Display new Monobehaviour methods as partially supported";
|
||||||
|
ToggleRecompileImmediately = "Recompile immediately";
|
||||||
|
ToggleRecompilePlayMode = "Recompile in Play Mode";
|
||||||
|
ToggleRecompileEditMode = "Recompile in Edit Mode";
|
||||||
|
ToggleRecompileExitPlayMode = "Recompile on exit Play Mode";
|
||||||
|
|
||||||
|
// Settings Options
|
||||||
|
OptionExposeServerShort = "Allow Devices to Connect";
|
||||||
|
OptionExposeServerFull = "Allow Devices to Connect (WiFi)";
|
||||||
|
OptionExposeServerDescriptionEnabled = "The HotReload server is reachable from devices on the same Wifi network";
|
||||||
|
OptionExposeServerDescriptionDisabled = "The HotReload server is available to your computer only. Other devices cannot connect to it.";
|
||||||
|
OptionAllowHttpRequests = "Allow app to make HTTP requests";
|
||||||
|
OptionAllowHttpRequestsDescription = "For Hot Reload to work on-device, please allow HTTP requests";
|
||||||
|
OptionIncludeInBuild = "Include Hot Reload in player builds";
|
||||||
|
OptionIncludeInBuildDescriptionEnabled = "The Hot Reload runtime is included in development builds that use the Mono scripting backend.";
|
||||||
|
OptionIncludeInBuildDescriptionDisabled = "The Hot Reload runtime will not be included in any build. Use this option to disable HotReload without removing it from your project.";
|
||||||
|
OptionIncludeInBuildDescriptionSuffix = " This option does not affect Hot Reload usage in Playmode";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Settings Tab
|
||||||
|
SettingsTitle = "设置";
|
||||||
|
SettingsConfiguration = "配置";
|
||||||
|
SettingsAdvanced = "高级";
|
||||||
|
SettingsOnDevice = "在设备上";
|
||||||
|
SettingsManualConnect = "手动连接";
|
||||||
|
SettingsBuildSettingsChecklist = "构建设置清单";
|
||||||
|
SettingsOptions = "选项";
|
||||||
|
SettingsVisualFeedback = "视觉反馈";
|
||||||
|
SettingsMisc = "杂项";
|
||||||
|
|
||||||
|
// Settings Descriptions
|
||||||
|
SettingsManageAutoRefreshOn = "为避免不必要的重新编译,Hot Reload 将自动更改 Unity 的自动刷新和脚本编译设置。停止 Hot Reload 后将恢复以前的设置";
|
||||||
|
SettingsManageAutoRefreshOff = "启用此设置以自动管理 Unity 的自动刷新和脚本编译设置。这可以减少不必要的重新编译";
|
||||||
|
SettingsAssetRefreshOn = "Hot Reload 将刷新已更改的资产,如精灵、预制件等";
|
||||||
|
SettingsAssetRefreshOff = "启用以允许 Hot Reload 刷新项目中已更改的资产。支持所有资产类型,包括精灵、预制件、着色器等";
|
||||||
|
SettingsDebuggerCompatibilityOn = "附加调试器时,Hot Reload 会自动禁用自身,因为它可能会干扰某些调试器功能。如果您考虑禁用此设置,请阅读文档。";
|
||||||
|
SettingsDebuggerCompatibilityOff = "附加调试器时,Hot Reload 将处于活动状态,但某些调试器功能可能无法按预期工作。请阅读我们的文档以了解限制。";
|
||||||
|
SettingsRefreshShadersOn = "Hot Reload 将自动刷新着色器。请注意,启用此设置可能会影响性能。";
|
||||||
|
SettingsRefreshShadersOff = "启用以自动刷新着色器。请注意,启用此设置可能会影响性能";
|
||||||
|
SettingsHideConsoleOn = "Hot Reload 启动时不会创建控制台窗口。可以通过“帮助”选项卡访问日志。";
|
||||||
|
SettingsHideConsoleOff = "启用以在不创建控制台窗口的情况下启动 Hot Reload。";
|
||||||
|
SettingsDeactivatedOn = "Hot Reload 已停用。";
|
||||||
|
SettingsDeactivatedOff = "启用以停用 Hot Reload。";
|
||||||
|
SettingsDisableErrorReportingOn = "详细错误报告已禁用。";
|
||||||
|
SettingsDisableErrorReportingOff = "切换以禁用详细错误报告。";
|
||||||
|
SettingsPauseEditModeOn = "在编辑模式下,Hot Reload 已暂停。建议在进入播放模式之前手动执行完整的 Unity 重新编译,以防止 Hot Reload 无法使用。";
|
||||||
|
SettingsPauseEditModeOff = "切换以在编辑模式下暂停 Hot Reload。启用此设置后,建议在进入播放模式之前手动执行完整的 Unity 重新编译,以防止 Hot Reload 无法使用。";
|
||||||
|
SettingsAutostartOn = "当 Unity 项目打开时,将启动 Hot Reload。";
|
||||||
|
SettingsAutostartOff = "启用以在 Unity 项目打开时启动 Hot Reload。";
|
||||||
|
SettingsPatchingIndicationUnsupported = "您使用的 Unity 版本不支持修补通知。";
|
||||||
|
SettingsPatchingIndicationOff = "启用以在修补时显示 GameView 和 SceneView 指示。";
|
||||||
|
SettingsPatchingIndicationOn = "修补时将在 GameView 和 SceneView 中显示指示。";
|
||||||
|
SettingsCompilingIndicationUnsupported = "您使用的 Unity 版本不支持编译不支持的更改通知。";
|
||||||
|
SettingsCompilingIndicationOff = "启用以在编译不支持的更改时显示 GameView 和 SceneView 指示。";
|
||||||
|
SettingsCompilingIndicationOn = "编译不支持的更改时将在 GameView 和 SceneView 中显示指示。";
|
||||||
|
SettingsAutoRecompileUnsupported = "您使用的 Unity 版本不支持自动重新编译不支持的更改。";
|
||||||
|
SettingsAutoRecompileOn = "在 Hot Reload 不支持的代码更改后,Hot Reload 将自动重新编译。";
|
||||||
|
SettingsAutoRecompileOff = "启用后,在 Hot Reload 不支持的代码更改后会自动进行重新编译。";
|
||||||
|
SettingsAutoRecompileInspectorOn = "对于在编辑模式下不支持的检查器字段更改,Hot Reload 将触发重新编译。";
|
||||||
|
SettingsAutoRecompileInspectorOff = "启用以在编辑模式下为不支持的检查器字段更改触发重新编译。";
|
||||||
|
SettingsAutoRecompilePartialOn = "Hot Reload 将重新编译部分不支持的更改。";
|
||||||
|
SettingsAutoRecompilePartialOff = "启用以重新编译部分不支持的更改。";
|
||||||
|
SettingsDisplayMonobehaviourOn = "Hot Reload 将把新的 monobehaviour 方法显示为部分不支持。";
|
||||||
|
SettingsDisplayMonobehaviourOff = "启用以将新的 monobehaviour 方法显示为部分不支持。";
|
||||||
|
SettingsRecompileImmediatelyOn = "不支持的更改将立即重新编译。";
|
||||||
|
SettingsRecompileImmediatelyOff = "当编辑器获得焦点时,将重新编译不支持的更改。启用以立即重新编译。";
|
||||||
|
SettingsRecompilePlayModeOn = "Hot Reload 将退出播放模式以重新编译不支持的更改。";
|
||||||
|
SettingsRecompilePlayModeOff = "启用以自动退出播放模式以重新编译不支持的更改。";
|
||||||
|
SettingsRecompileEditModeOn = "Hot Reload 在编辑模式下重新编译不支持的更改。";
|
||||||
|
SettingsRecompileEditModeOff = "启用以在编辑模式下自动重新编译不支持的更改。";
|
||||||
|
SettingsRecompileExitPlayModeOn = "退出播放模式时,Hot Reload 将重新编译不支持的更改。";
|
||||||
|
SettingsRecompileExitPlayModeOff = "启用以在退出播放模式时重新编译不支持的更改。";
|
||||||
|
SettingsIndicationsUnsupported = "您使用的 Unity 版本不支持指示。";
|
||||||
|
|
||||||
|
// Settings Toggle Names
|
||||||
|
ToggleManageAutoRefresh = "管理 Unity 自动刷新(推荐)";
|
||||||
|
ToggleAssetRefresh = "资产刷新(推荐)";
|
||||||
|
ToggleDebuggerCompatibility = "附加调试器时自动禁用 Hot Reload(推荐)";
|
||||||
|
ToggleRefreshShaders = "刷新着色器";
|
||||||
|
ToggleHideConsole = "启动时隐藏控制台窗口";
|
||||||
|
ToggleDeactivate = "停用 Hot Reload";
|
||||||
|
ToggleDisableErrorReporting = "禁用详细错误报告";
|
||||||
|
TogglePauseEditMode = "在编辑模式下暂停 Hot Reload";
|
||||||
|
ToggleAutostart = "在 Unity 打开时自动启动";
|
||||||
|
TogglePatchingIndication = "修补指示";
|
||||||
|
ToggleCompilingIndication = "编译不支持的更改指示";
|
||||||
|
ToggleAutoRecompile = "自动重新编译不支持的更改(推荐)";
|
||||||
|
ToggleAutoRecompileInspector = "自动重新编译检查器字段编辑";
|
||||||
|
ToggleAutoRecompilePartial = "包括部分不支持的更改";
|
||||||
|
ToggleDisplayMonobehaviour = "将新的 Monobehaviour 方法显示为部分支持";
|
||||||
|
ToggleRecompileImmediately = "立即重新编译";
|
||||||
|
ToggleRecompilePlayMode = "在播放模式下重新编译";
|
||||||
|
ToggleRecompileEditMode = "在编辑模式下重新编译";
|
||||||
|
ToggleRecompileExitPlayMode = "退出播放模式时重新编译";
|
||||||
|
|
||||||
|
// Settings Options
|
||||||
|
OptionExposeServerShort = "允许设备连接";
|
||||||
|
OptionExposeServerFull = "允许设备连接 (WiFi)";
|
||||||
|
OptionExposeServerDescriptionEnabled = "HotReload 服务器可从同一 Wifi 网络上的设备访问";
|
||||||
|
OptionExposeServerDescriptionDisabled = "HotReload 服务器仅对您的计算机可用。其他设备无法连接到它。";
|
||||||
|
OptionAllowHttpRequests = "允许应用发出 HTTP 请求";
|
||||||
|
OptionAllowHttpRequestsDescription = "为了让 Hot Reload 在设备上工作,请允许 HTTP 请求";
|
||||||
|
OptionIncludeInBuild = "在播放器构建中包含 Hot Reload";
|
||||||
|
OptionIncludeInBuildDescriptionEnabled = "Hot Reload 运行时包含在使用 Mono 脚本后端的开发构建中。";
|
||||||
|
OptionIncludeInBuildDescriptionDisabled = "Hot Reload 运行时将不包含在任何构建中。使用此选项可在不从项目中删除 HotReload 的情况下禁用它。";
|
||||||
|
OptionIncludeInBuildDescriptionSuffix = " 此选项不影响在播放模式下使用 Hot Reload";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: df46693e37527a74b8c24e95da9a4c47
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Suggestions {
|
||||||
|
// Button texts
|
||||||
|
public static string ButtonDocs;
|
||||||
|
public static string ButtonMoreInfo;
|
||||||
|
public static string ButtonVote;
|
||||||
|
public static string ButtonUseBuildTimeOnlyAtlas;
|
||||||
|
public static string ButtonOpenSettings;
|
||||||
|
public static string ButtonIgnoreSuggestion;
|
||||||
|
public static string ButtonLearnMore;
|
||||||
|
public static string ButtonStopHotReload;
|
||||||
|
public static string ButtonDontShowAgain;
|
||||||
|
public static string ButtonOK;
|
||||||
|
public static string ButtonOKPadded;
|
||||||
|
public static string ButtonDisable;
|
||||||
|
public static string ButtonTurnOff;
|
||||||
|
public static string ButtonAutoRecompile;
|
||||||
|
public static string ButtonSwitchToDebugMode;
|
||||||
|
public static string ButtonKeepEnabledDuringDebugging;
|
||||||
|
public static string ButtonRecompile;
|
||||||
|
|
||||||
|
// Unity Best Development Tool Award 2023
|
||||||
|
public static string Award2023Title;
|
||||||
|
public static string Award2023Message;
|
||||||
|
|
||||||
|
// Unsupported Changes
|
||||||
|
public static string UnsupportedChangesTitle;
|
||||||
|
public static string UnsupportedChangesMessage;
|
||||||
|
|
||||||
|
// Unsupported Packages
|
||||||
|
public static string UnsupportedPackagesTitle;
|
||||||
|
public static string UnsupportedPackagesMessage;
|
||||||
|
|
||||||
|
// Auto Recompiled When Playmode State Changes
|
||||||
|
public static string AutoRecompiledPlaymodeTitle;
|
||||||
|
public static string AutoRecompiledPlaymodeMessage;
|
||||||
|
|
||||||
|
// Auto Recompiled When Playmode State Changes 2022
|
||||||
|
public static string AutoRecompiled2022Title;
|
||||||
|
public static string AutoRecompiled2022Message;
|
||||||
|
|
||||||
|
// Multidimensional Arrays
|
||||||
|
public static string MultidimensionalArraysTitle;
|
||||||
|
public static string MultidimensionalArraysMessage;
|
||||||
|
|
||||||
|
// Editors Without HR Running
|
||||||
|
public static string EditorsWithoutHRTitle;
|
||||||
|
public static string EditorsWithoutHRMessage;
|
||||||
|
|
||||||
|
// Field Initializer With Side Effects
|
||||||
|
public static string FieldInitializerSideEffectsTitle;
|
||||||
|
public static string FieldInitializerSideEffectsMessage;
|
||||||
|
|
||||||
|
// Detailed Error Reporting Is Enabled
|
||||||
|
public static string DetailedErrorReportingTitle;
|
||||||
|
public static string DetailedErrorReportingMessage;
|
||||||
|
|
||||||
|
// Field Initializer Existing Instances Edited
|
||||||
|
public static string FieldInitializerEditedTitle;
|
||||||
|
public static string FieldInitializerEditedMessage;
|
||||||
|
|
||||||
|
// Field Initializer Existing Instances Unedited
|
||||||
|
public static string FieldInitializerUneditedTitle;
|
||||||
|
public static string FieldInitializerUneditedMessage;
|
||||||
|
|
||||||
|
// Add Monobehaviour Method
|
||||||
|
public static string AddMonobehaviourMethodTitle;
|
||||||
|
public static string AddMonobehaviourMethodMessage;
|
||||||
|
|
||||||
|
// Switch To Debug Mode For Inlined Methods
|
||||||
|
public static string SwitchToDebugModeTitle;
|
||||||
|
public static string SwitchToDebugModeMessage;
|
||||||
|
public static string SwitchToDebugModeConfirmation;
|
||||||
|
|
||||||
|
// Hot Reload While Debugger Is Attached
|
||||||
|
public static string DebuggerAttachedTitle;
|
||||||
|
public static string DebuggerAttachedMessage;
|
||||||
|
|
||||||
|
// Hot Reloaded Methods When Debugger Is Attached
|
||||||
|
public static string DebuggerMethodsTitle;
|
||||||
|
public static string DebuggerMethodsMessage;
|
||||||
|
public static string DebuggerMethodsConfirmation;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Button texts
|
||||||
|
ButtonDocs = "Docs";
|
||||||
|
ButtonMoreInfo = "More Info";
|
||||||
|
ButtonVote = " Vote ";
|
||||||
|
ButtonUseBuildTimeOnlyAtlas = " Use \"Build Time Only Atlas\" ";
|
||||||
|
ButtonOpenSettings = " Open Settings ";
|
||||||
|
ButtonIgnoreSuggestion = " Ignore suggestion ";
|
||||||
|
ButtonLearnMore = " Learn more ";
|
||||||
|
ButtonStopHotReload = " Stop Hot Reload ";
|
||||||
|
ButtonDontShowAgain = " Don't show again ";
|
||||||
|
ButtonOK = " OK ";
|
||||||
|
ButtonOKPadded = " OK ";
|
||||||
|
ButtonDisable = " Disable ";
|
||||||
|
ButtonTurnOff = " Turn off ";
|
||||||
|
ButtonAutoRecompile = " Auto Recompile ";
|
||||||
|
ButtonSwitchToDebugMode = " Switch to Debug mode ";
|
||||||
|
ButtonKeepEnabledDuringDebugging = " Keep enabled during debugging ";
|
||||||
|
ButtonRecompile = " Recompile ";
|
||||||
|
|
||||||
|
// Unity Best Development Tool Award 2023
|
||||||
|
Award2023Title = "Vote for the \"Best Development Tool\" Award!";
|
||||||
|
Award2023Message = "Hot Reload was nominated for the \"Best Development Tool\" Award. Please consider voting. Thank you!";
|
||||||
|
|
||||||
|
// Unsupported Changes
|
||||||
|
UnsupportedChangesTitle = "Which changes does Hot Reload support?";
|
||||||
|
UnsupportedChangesMessage = "Hot Reload supports most code changes, but there are some limitations. Generally, changes to methods and fields are supported. Things like adding new types is not (yet) supported. See the documentation for the list of current features and our current roadmap";
|
||||||
|
|
||||||
|
// Unsupported Packages
|
||||||
|
UnsupportedPackagesTitle = "Unsupported package detected";
|
||||||
|
UnsupportedPackagesMessage = "The following packages are only partially supported: ECS, Mirror, Fishnet, and Photon. Hot Reload will work in the project, but changes specific to those packages might not hot-reload";
|
||||||
|
|
||||||
|
// Auto Recompiled When Playmode State Changes
|
||||||
|
AutoRecompiledPlaymodeTitle = "Unity recompiles on enter/exit play mode?";
|
||||||
|
AutoRecompiledPlaymodeMessage = "If you have an issue with the Unity Editor recompiling when the Play Mode state changes, more info is available in the docs. Feel free to reach out if you require assistance. We'll be glad to help.";
|
||||||
|
|
||||||
|
// Auto Recompiled When Playmode State Changes 2022
|
||||||
|
AutoRecompiled2022Title = "Unsupported setting detected";
|
||||||
|
AutoRecompiled2022Message = "The 'Sprite Packer Mode' setting can cause unintended recompilations if set to 'Sprite Atlas V1 - Always Enabled'";
|
||||||
|
|
||||||
|
// Multidimensional Arrays
|
||||||
|
MultidimensionalArraysTitle = "Use jagged instead of multidimensional arrays";
|
||||||
|
MultidimensionalArraysMessage = "Hot Reload doesn't support methods with multidimensional arrays ([,]). You can work around this by using jagged arrays ([][])"
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
// Editors Without HR Running
|
||||||
|
EditorsWithoutHRTitle = "Some Unity instances don't have Hot Reload running.";
|
||||||
|
EditorsWithoutHRMessage = "Make sure that either: \n1) Hot Reload is installed and running on all Editor instances, or \n2) Hot Reload is stopped in all Editor instances where it is installed.";
|
||||||
|
|
||||||
|
// Field Initializer With Side Effects
|
||||||
|
FieldInitializerSideEffectsTitle = "Field initializer with side-effects detected";
|
||||||
|
FieldInitializerSideEffectsMessage = "A field initializer update might have side effects, e.g. calling a method or creating an object.\n\nWhile Hot Reload does support this, it can sometimes be confusing when the initializer logic runs at 'unexpected times'.";
|
||||||
|
|
||||||
|
// Detailed Error Reporting Is Enabled
|
||||||
|
DetailedErrorReportingTitle = "Detailed error reporting is enabled";
|
||||||
|
DetailedErrorReportingMessage = "When an error happens in Hot Reload, the exception stacktrace is sent as telemetry to help diagnose and fix the issue.\nThe exception stack trace is only included if it originated from the Hot Reload package or binary. Stacktraces from your own code are not sent.\nYou can disable detailed error reporting to prevent telemetry from including any information about your project.";
|
||||||
|
|
||||||
|
// Field Initializer Existing Instances Edited
|
||||||
|
FieldInitializerEditedTitle = "Field initializer edit updated the value of existing class instances";
|
||||||
|
FieldInitializerEditedMessage = "By default, Hot Reload updates field values of existing object instances when new field initializer has constant value.\n\nIf you want to change this behavior, disable the \"Apply field initializer edits to existing class instances\" option in Settings or click the button below.";
|
||||||
|
|
||||||
|
// Field Initializer Existing Instances Unedited
|
||||||
|
FieldInitializerUneditedTitle = "Field initializer edits don't apply to existing objects";
|
||||||
|
FieldInitializerUneditedMessage = "By default, Hot Reload applies field initializer edits of existing fields only to new objects (newly instantiated classes), just like normal C#.\n\nFor rapid prototyping, you can use static fields which will update across all instances.";
|
||||||
|
|
||||||
|
// Add Monobehaviour Method
|
||||||
|
AddMonobehaviourMethodTitle = "New MonoBehaviour methods are not shown in the inspector";
|
||||||
|
AddMonobehaviourMethodMessage = "New methods in MonoBehaviours are not shown in the inspector until the script is recompiled. This is a limitation of Hot Reload handling of Unity's serialization system.\n\nYou can use the button below to auto recompile partially supported changes such as this one.";
|
||||||
|
|
||||||
|
// Switch To Debug Mode For Inlined Methods
|
||||||
|
SwitchToDebugModeTitle = "Switch code optimization to Debug Mode";
|
||||||
|
SwitchToDebugModeMessage = "In Release Mode some methods are inlined, which prevents Hot Reload from applying changes. A clear warning is always shown when this happens, but you can use Debug Mode to avoid the issue altogether";
|
||||||
|
SwitchToDebugModeConfirmation = "Switching code optimization will stop Play Mode.\n\nDo you wish to proceed?";
|
||||||
|
|
||||||
|
// Hot Reload While Debugger Is Attached
|
||||||
|
DebuggerAttachedTitle = "Hot Reload is disabled while a debugger is attached";
|
||||||
|
DebuggerAttachedMessage = "Hot Reload automatically disables itself while a debugger is attached, as it can otherwise interfere with certain debugger features.\nWhile disabled, every code change will trigger a full Unity recompilation.\n\nYou can choose to keep Hot Reload enabled while a debugger is attached, though some features like debugger variable inspection might not always work as expected.";
|
||||||
|
|
||||||
|
// Hot Reloaded Methods When Debugger Is Attached
|
||||||
|
DebuggerMethodsTitle = "Hot Reload may interfere with your debugger session";
|
||||||
|
DebuggerMethodsMessage = "Some debugger features, like variable inspection, might not work as expected for methods patched during the Hot Reload session. A full Unity recompile is required to get the full debugger experience.";
|
||||||
|
DebuggerMethodsConfirmation = "Using the Recompile button will stop Play Mode.\n\nDo you wish to proceed?";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Button texts
|
||||||
|
ButtonDocs = "文档";
|
||||||
|
ButtonMoreInfo = "更多信息";
|
||||||
|
ButtonVote = " 投票 ";
|
||||||
|
ButtonUseBuildTimeOnlyAtlas = " 使用“仅构建时图集” ";
|
||||||
|
ButtonOpenSettings = " 打开设置 ";
|
||||||
|
ButtonIgnoreSuggestion = " 忽略建议 ";
|
||||||
|
ButtonLearnMore = " 了解更多 ";
|
||||||
|
ButtonStopHotReload = " 停止 Hot Reload ";
|
||||||
|
ButtonDontShowAgain = " 不再显示 ";
|
||||||
|
ButtonOK = " 确定 ";
|
||||||
|
ButtonOKPadded = " 确定 ";
|
||||||
|
ButtonDisable = " 禁用 ";
|
||||||
|
ButtonTurnOff = " 关闭 ";
|
||||||
|
ButtonAutoRecompile = " 自动重新编译 ";
|
||||||
|
ButtonSwitchToDebugMode = " 切换到调试模式 ";
|
||||||
|
ButtonKeepEnabledDuringDebugging = " 在调试期间保持启用 ";
|
||||||
|
ButtonRecompile = " 重新编译 ";
|
||||||
|
|
||||||
|
// Unity Best Development Tool Award 2023
|
||||||
|
Award2023Title = "为“最佳开发工具”奖投票!";
|
||||||
|
Award2023Message = "Hot Reload 被提名为“最佳开发工具”奖。请考虑投票。谢谢!";
|
||||||
|
|
||||||
|
// Unsupported Changes
|
||||||
|
UnsupportedChangesTitle = "Hot Reload 支持哪些更改?";
|
||||||
|
UnsupportedChangesMessage = "Hot Reload 支持大多数代码更改,但存在一些限制。通常支持对方法和字段的更改。尚不支持添加新类型等操作。有关当前功能列表和我们当前路线图,请参阅文档";
|
||||||
|
|
||||||
|
// Unsupported Packages
|
||||||
|
UnsupportedPackagesTitle = "检测到不支持的包";
|
||||||
|
UnsupportedPackagesMessage = "以下包仅部分支持:ECS、Mirror、Fishnet 和 Photon。Hot Reload 可以在项目中使用,但针对这些包的特定更改可能无法热重载";
|
||||||
|
|
||||||
|
// Auto Recompiled When Playmode State Changes
|
||||||
|
AutoRecompiledPlaymodeTitle = "Unity 在进入/退出播放模式时重新编译?";
|
||||||
|
AutoRecompiledPlaymodeMessage = "如果您在播放模式状态更改时遇到 Unity 编辑器重新编译的问题,可以在文档中找到更多信息。如果您需要帮助,请随时与我们联系。我们很乐意提供帮助。";
|
||||||
|
|
||||||
|
// Auto Recompiled When Playmode State Changes 2022
|
||||||
|
AutoRecompiled2022Title = "检测到不支持的设置";
|
||||||
|
AutoRecompiled2022Message = "如果“精灵打包器模式”设置为“精灵图集 V1 - 始终启用”,则可能导致意外的重新编译";
|
||||||
|
|
||||||
|
// Multidimensional Arrays
|
||||||
|
MultidimensionalArraysTitle = "使用交错数组代替多维数组";
|
||||||
|
MultidimensionalArraysMessage = "Hot Reload 不支持带有二维数组 ([,]) 的方法。您可以通过使用交错数组 ([][]) 来解决此问题";
|
||||||
|
|
||||||
|
// Editors Without HR Running
|
||||||
|
EditorsWithoutHRTitle = "一些 Unity 实例没有运行 Hot Reload。";
|
||||||
|
EditorsWithoutHRMessage = "请确保:\n1) 在所有编辑器实例上安装并运行 Hot Reload,或\n2) 在所有安装了 Hot Reload 的编辑器实例中停止它。";
|
||||||
|
|
||||||
|
// Field Initializer With Side Effects
|
||||||
|
FieldInitializerSideEffectsTitle = "检测到带有副作用的字段初始化器";
|
||||||
|
FieldInitializerSideEffectsMessage = "字段初始化器更新可能有副作用,例如调用方法或创建对象。\n\n虽然 Hot Reload 支持此功能,但当初始化器逻辑在“意外时间”运行时,有时可能会令人困惑。";
|
||||||
|
|
||||||
|
// Detailed Error Reporting Is Enabled
|
||||||
|
DetailedErrorReportingTitle = "已启用详细错误报告";
|
||||||
|
DetailedErrorReportingMessage = "当 Hot Reload 中发生错误时,异常堆栈跟踪将作为遥测数据发送,以帮助诊断和修复问题。\n仅当异常堆栈跟踪源自 Hot Reload 包或二进制文件时才会包含。不会发送您自己代码的堆栈跟踪。\n您可以禁用详细错误报告,以防止遥测数据包含有关您项目的任何信息。";
|
||||||
|
|
||||||
|
// Field Initializer Existing Instances Edited
|
||||||
|
FieldInitializerEditedTitle = "字段初始化器编辑更新了现有类实例的值";
|
||||||
|
FieldInitializerEditedMessage = "默认情况下,当新的字段初始化器具有常量值时,Hot Reload 会更新现有对象实例的字段值。\n\n如果您想更改此行为,请在“设置”中禁用“将字段初始化器编辑应用于现有类实例”选项,或单击下面的按钮。";
|
||||||
|
|
||||||
|
// Field Initializer Existing Instances Unedited
|
||||||
|
FieldInitializerUneditedTitle = "字段初始化器编辑不适用于现有对象";
|
||||||
|
FieldInitializerUneditedMessage = "默认情况下,Hot Reload 仅将现有字段的字段初始化器编辑应用于新对象(新实例化的类),就像普通的 C# 一样。\n\n为了快速原型制作,您可以使用静态字段,它将在所有实例中更新。";
|
||||||
|
|
||||||
|
// Add Monobehaviour Method
|
||||||
|
AddMonobehaviourMethodTitle = "新的 MonoBehaviour 方法不会显示在检查器中";
|
||||||
|
AddMonobehaviourMethodMessage = "在重新编译脚本之前,MonoBehaviours 中的新方法不会显示在检查器中。这是 Hot Reload 处理 Unity 序列化系统的限制。\n\n您可以使用下面的按钮自动重新编译部分支持的更改,例如此更改。";
|
||||||
|
|
||||||
|
// Switch To Debug Mode For Inlined Methods
|
||||||
|
SwitchToDebugModeTitle = "将代码优化切换到调试模式";
|
||||||
|
SwitchToDebugModeMessage = "在发布模式下,某些方法是内联的,这会阻止 Hot Reload 应用更改。发生这种情况时总是会显示明确的警告,但您可以使用调试模式完全避免此问题";
|
||||||
|
SwitchToDebugModeConfirmation = "切换代码优化将停止播放模式。\n\n您希望继续吗?";
|
||||||
|
|
||||||
|
// Hot Reload While Debugger Is Attached
|
||||||
|
DebuggerAttachedTitle = "附加调试器时禁用 Hot Reload";
|
||||||
|
DebuggerAttachedMessage = "附加调试器时,Hot Reload 会自动禁用自身,因为它可能会干扰某些调试器功能。\n禁用后,每次代码更改都会触发完整的 Unity 重新编译。\n\n您可以选择在附加调试器时保持 Hot Reload 启用,但某些功能(如调试器变量检查)可能不总是按预期工作。";
|
||||||
|
|
||||||
|
// Hot Reloaded Methods When Debugger Is Attached
|
||||||
|
DebuggerMethodsTitle = "Hot Reload 可能会干扰您的调试会话";
|
||||||
|
DebuggerMethodsMessage = "某些调试器功能,例如变量检查,对于在 Hot Reload 会话期间修补的方法可能无法按预期工作。需要完整的 Unity 重新编译才能获得完整的调试器体验。";
|
||||||
|
DebuggerMethodsConfirmation = "使用“重新编译”按钮将停止播放模式。\n\n您希望继续吗?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3a2d7e9f8b1c4a5e9d6f8a7b9c1d2e3f
|
||||||
|
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Timeline {
|
||||||
|
// Timeline/Events
|
||||||
|
public static string TimelineTitle;
|
||||||
|
public static string SuggestionsTitle;
|
||||||
|
public static string MessageCompleteRegistration;
|
||||||
|
public static string MessageUseStartButton;
|
||||||
|
public static string MessageEnableFilters;
|
||||||
|
public static string MessageMakeCodeChanges;
|
||||||
|
public static string MessageOnly40EntriesShown;
|
||||||
|
public static string EventsTooltip;
|
||||||
|
public static string LabelSuggestionsFormat;
|
||||||
|
public static string LabelTimeline;
|
||||||
|
public static string ButtonIgnoreEventType;
|
||||||
|
public static string MessageStartHotReload;
|
||||||
|
|
||||||
|
// Partially Supported Change Descriptions
|
||||||
|
public static string PartiallySupportedLambdaClosure;
|
||||||
|
public static string PartiallySupportedEditAsyncMethod;
|
||||||
|
public static string PartiallySupportedAddMonobehaviourMethod;
|
||||||
|
public static string PartiallySupportedEditMonobehaviourField;
|
||||||
|
public static string PartiallySupportedEditCoroutine;
|
||||||
|
public static string PartiallySupportedEditGenericFieldInitializer;
|
||||||
|
public static string PartiallySupportedAddEnumMember;
|
||||||
|
public static string PartiallySupportedEditFieldInitializer;
|
||||||
|
public static string PartiallySupportedAddMethodWithAttributes;
|
||||||
|
public static string PartiallySupportedAddFieldWithAttributes;
|
||||||
|
public static string PartiallySupportedGenericMethodInGenericClass;
|
||||||
|
public static string PartiallySupportedNewCustomSerializableField;
|
||||||
|
public static string PartiallySupportedMultipleFieldsEditedInTheSameType;
|
||||||
|
|
||||||
|
// Event Entry Titles and Descriptions
|
||||||
|
public static string EventTitleFailedApplyingPatch;
|
||||||
|
public static string EventDescriptionInlinedMethods;
|
||||||
|
public static string EventDescriptionNoIssuesFound;
|
||||||
|
public static string EventDescriptionSeeUnsupportedChangesBelow;
|
||||||
|
public static string EventDescriptionSeeDetailedEntriesBelow;
|
||||||
|
public static string EventDescriptionSeePartiallyAppliedChangesBelow;
|
||||||
|
public static string EventDescriptionUndetectedChange;
|
||||||
|
public static string EventTitleChangePartiallyApplied;
|
||||||
|
public static string EventDescriptionFailedApplyingPatchTapForMore;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Timeline/Events
|
||||||
|
TimelineTitle = "Timeline";
|
||||||
|
SuggestionsTitle = "Suggestions";
|
||||||
|
MessageCompleteRegistration = "Complete registration before using Hot Reload";
|
||||||
|
MessageUseStartButton = "Use the Start button to activate Hot Reload";
|
||||||
|
MessageEnableFilters = "Enable filters to see events";
|
||||||
|
MessageMakeCodeChanges = "Make code changes to see events";
|
||||||
|
MessageOnly40EntriesShown = "Only last 40 entries are shown";
|
||||||
|
EventsTooltip = "Events";
|
||||||
|
LabelSuggestionsFormat = "Suggestions ({0})";
|
||||||
|
LabelTimeline = "Timeline";
|
||||||
|
ButtonIgnoreEventType = "Ignore this event type ";
|
||||||
|
MessageStartHotReload = "Press Start to begin using Hot Reload";
|
||||||
|
|
||||||
|
// Partially Supported Change Descriptions
|
||||||
|
PartiallySupportedLambdaClosure = "A lambda closure was edited (captured variable was added or removed). Changes to it will only be visible to the next created lambda(s).";
|
||||||
|
PartiallySupportedEditAsyncMethod = "An async method was edited. Changes to it will only be visible the next time this method is called.";
|
||||||
|
PartiallySupportedAddMonobehaviourMethod = "A new method was added or made public. It will not show up in the Inspector until the next full recompilation.";
|
||||||
|
PartiallySupportedEditMonobehaviourField = "A field in a MonoBehaviour was removed or reordered. The inspector will not notice this change until the next full recompilation.";
|
||||||
|
PartiallySupportedEditCoroutine = "An IEnumerator/IEnumerable was edited. When used as a coroutine, changes to it will only be visible the next time the coroutine is created.";
|
||||||
|
PartiallySupportedEditGenericFieldInitializer = "A field initializer inside generic class was edited. Field initializer will not have any effect until the next full recompilation.";
|
||||||
|
PartiallySupportedAddEnumMember = "An enum member was added. ToString and other reflection methods work only after the next full recompilation. Additionally, changes to the enum order may not apply until you patch usages in other places of the code.";
|
||||||
|
PartiallySupportedEditFieldInitializer = "A field initializer was edited. Changes will only apply to new instances of that type, since the initializer for an object only runs when it is created.";
|
||||||
|
PartiallySupportedAddMethodWithAttributes = "A method with attributes was added. Method attributes will not have any effect until the next full recompilation.";
|
||||||
|
PartiallySupportedAddFieldWithAttributes = "A field with attributes was added. Field attributes will not have any effect until the next full recompilation.";
|
||||||
|
PartiallySupportedGenericMethodInGenericClass = "A generic method was edited. Usages in non-generic classes applied, but usages in the generic classes are not supported.";
|
||||||
|
PartiallySupportedNewCustomSerializableField = "A new custom serializable field was added. The inspector will not notice this change until the next full recompilation.";
|
||||||
|
PartiallySupportedMultipleFieldsEditedInTheSameType = "Multiple fields modified in the same type during a single patch. Their values have been reset.";
|
||||||
|
|
||||||
|
// Event Entry Titles and Descriptions
|
||||||
|
EventTitleFailedApplyingPatch = "Failed applying patch to method";
|
||||||
|
EventDescriptionInlinedMethods = "Some methods got inlined by the Unity compiler and cannot be patched by Hot Reload. Switch to Debug mode to avoid this problem.";
|
||||||
|
EventDescriptionNoIssuesFound = "No issues found";
|
||||||
|
EventDescriptionSeeUnsupportedChangesBelow = "See unsupported changes below";
|
||||||
|
EventDescriptionSeeDetailedEntriesBelow = "See detailed entries below";
|
||||||
|
EventDescriptionSeePartiallyAppliedChangesBelow = "See partially applied changes below";
|
||||||
|
EventDescriptionUndetectedChange = "Code semantics didn't change (e.g. whitespace) or the change requires manual recompile.\n\nRecompile to force-apply changes.";
|
||||||
|
EventTitleChangePartiallyApplied = "Change partially applied";
|
||||||
|
EventDescriptionFailedApplyingPatchTapForMore = "{0}: {1}, tap here to see more.";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Timeline/Events
|
||||||
|
TimelineTitle = "时间线";
|
||||||
|
SuggestionsTitle = "建议";
|
||||||
|
MessageCompleteRegistration = "在使用 Hot Reload 前完成注册";
|
||||||
|
MessageUseStartButton = "使用开始按钮激活 Hot Reload";
|
||||||
|
MessageEnableFilters = "启用过滤器以查看事件";
|
||||||
|
MessageMakeCodeChanges = "进行代码更改以查看事件";
|
||||||
|
MessageOnly40EntriesShown = "仅显示最后 40 个条目";
|
||||||
|
EventsTooltip = "事件";
|
||||||
|
LabelSuggestionsFormat = "建议 ({0})";
|
||||||
|
LabelTimeline = "时间线";
|
||||||
|
ButtonIgnoreEventType = "忽略此事件类型 ";
|
||||||
|
MessageStartHotReload = "按开始以开始使用 Hot Reload";
|
||||||
|
|
||||||
|
// Partially Supported Change Descriptions
|
||||||
|
PartiallySupportedLambdaClosure = "编辑了 lambda 闭包(添加或删除了捕获的变量)。对其的更改仅对下一个创建的 lambda 可见。";
|
||||||
|
PartiallySupportedEditAsyncMethod = "编辑了异步方法。对其的更改仅在下次调用此方法时可见。";
|
||||||
|
PartiallySupportedAddMonobehaviourMethod = "添加了新方法或将其设为公共。在下次完全重新编译之前,它不会显示在检查器中。";
|
||||||
|
PartiallySupportedEditMonobehaviourField = "删除了 MonoBehaviour 中的字段或重新排序。在下次完全重新编译之前,检查器不会注意到此更改。";
|
||||||
|
PartiallySupportedEditCoroutine = "编辑了 IEnumerator/IEnumerable。当用作协程时,对其的更改仅在下次创建协程时可见。";
|
||||||
|
PartiallySupportedEditGenericFieldInitializer = "编辑了泛型类中的字段初始化器。在下次完全重新编译之前,字段初始化器不会有任何效果。";
|
||||||
|
PartiallySupportedAddEnumMember = "添加了枚举成员。ToString 和其他反射方法仅在下次完全重新编译后才起作用。此外,在您修补代码中其他地方的用法之前,对枚举顺序的更改可能不会应用。";
|
||||||
|
PartiallySupportedEditFieldInitializer = "编辑了字段初始化器。更改仅适用于该类型的新实例,因为对象的初始化器仅在创建时运行。";
|
||||||
|
PartiallySupportedAddMethodWithAttributes = "添加了带属性的方法。在下次完全重新编译之前,方法属性不会有任何效果。";
|
||||||
|
PartiallySupportedAddFieldWithAttributes = "添加了带属性的字段。在下次完全重新编译之前,字段属性不会有任何效果。";
|
||||||
|
PartiallySupportedGenericMethodInGenericClass = "编辑了泛型方法。在非泛型类中的用法已应用,但不支持在泛型类中的用法。";
|
||||||
|
PartiallySupportedNewCustomSerializableField = "添加了新的自定义可序列化字段。在下次完全重新编译之前,检查器不会注意到此更改。";
|
||||||
|
PartiallySupportedMultipleFieldsEditedInTheSameType = "在单个补丁期间,在同一类型中修改了多个字段。它们的值已被重置。";
|
||||||
|
|
||||||
|
// Event Entry Titles and Descriptions
|
||||||
|
EventTitleFailedApplyingPatch = "将补丁应用于方法失败";
|
||||||
|
EventDescriptionInlinedMethods = "某些方法被 Unity 编译器内联,无法被 Hot Reload 修补。切换到调试模式以避免此问题。";
|
||||||
|
EventDescriptionNoIssuesFound = "未发现问题";
|
||||||
|
EventDescriptionSeeUnsupportedChangesBelow = "请参阅下面的不支持的更改";
|
||||||
|
EventDescriptionSeeDetailedEntriesBelow = "请参阅下面的详细条目";
|
||||||
|
EventDescriptionSeePartiallyAppliedChangesBelow = "请参阅下面部分应用的更改";
|
||||||
|
EventDescriptionUndetectedChange = "代码语义未更改(例如空格)或更改需要手动重新编译。\n\n重新编译以强制应用更改。";
|
||||||
|
EventTitleChangePartiallyApplied = "更改部分应用";
|
||||||
|
EventDescriptionFailedApplyingPatchTapForMore = "{0}: {1},点击此处查看更多。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f7d83a43b1da0f14c860b06211f42149
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class UI {
|
||||||
|
// Run Tab
|
||||||
|
public static string RunTabTitle;
|
||||||
|
public static string RunTabTooltip;
|
||||||
|
public static string TapToShowStacktrace;
|
||||||
|
public static string CompileErrorMessage;
|
||||||
|
public static string UnsupportedChangeMessage;
|
||||||
|
public static string TapHereToSeeMore;
|
||||||
|
public static string ClickableDescription;
|
||||||
|
public static string SessionRefreshString;
|
||||||
|
public static string RecompileButtonLabel;
|
||||||
|
public static string StartButtonLabel;
|
||||||
|
public static string StopButtonLabel;
|
||||||
|
|
||||||
|
// License Messages
|
||||||
|
public static string TrialLicenseMessage;
|
||||||
|
public static string IndieLicenseMessage;
|
||||||
|
public static string LicenseRenewalMessage;
|
||||||
|
public static string BusinessLicenseMessage;
|
||||||
|
|
||||||
|
// Startup Messages
|
||||||
|
public static string StartingHotReloadMessage;
|
||||||
|
|
||||||
|
public static string OverlayPanelName;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
// Run Tab
|
||||||
|
RunTabTitle = "Run";
|
||||||
|
RunTabTooltip = "Run and monitor the current Hot Reload session.";
|
||||||
|
TapToShowStacktrace = "Tap to show stacktrace";
|
||||||
|
CompileErrorMessage = "Compile error";
|
||||||
|
UnsupportedChangeMessage = "Unsupported change detected";
|
||||||
|
TapHereToSeeMore = "tap here to see more.";
|
||||||
|
ClickableDescription = "Unsupported change";
|
||||||
|
SessionRefreshString = "Next Session: {0}h {1}min";
|
||||||
|
RecompileButtonLabel = " Recompile";
|
||||||
|
StartButtonLabel = " Start";
|
||||||
|
StopButtonLabel = " Stop";
|
||||||
|
|
||||||
|
// License Messages
|
||||||
|
TrialLicenseMessage = "Using Trial license, valid until {0}";
|
||||||
|
IndieLicenseMessage = " Indie license active";
|
||||||
|
LicenseRenewalMessage = "License will renew on {0}.";
|
||||||
|
BusinessLicenseMessage = " Business license active";
|
||||||
|
|
||||||
|
// Startup Messages
|
||||||
|
StartingHotReloadMessage = "Starting Hot Reload";
|
||||||
|
|
||||||
|
// Overlay
|
||||||
|
OverlayPanelName = "Hot Reload Indication";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
// Run Tab
|
||||||
|
RunTabTitle = "运行";
|
||||||
|
RunTabTooltip = "运行并监控当前的 Hot Reload 会话。";
|
||||||
|
TapToShowStacktrace = "点击以显示堆栈跟踪";
|
||||||
|
CompileErrorMessage = "编译错误";
|
||||||
|
UnsupportedChangeMessage = "检测到不支持的更改";
|
||||||
|
TapHereToSeeMore = "点击此处查看更多。";
|
||||||
|
ClickableDescription = "不支持的更改";
|
||||||
|
SessionRefreshString = "下一会话:{0}h {1}min";
|
||||||
|
RecompileButtonLabel = " 重新编译";
|
||||||
|
StartButtonLabel = " 开始";
|
||||||
|
StopButtonLabel = " 停止";
|
||||||
|
|
||||||
|
// License Messages
|
||||||
|
TrialLicenseMessage = "正在使用试用许可证,有效期至 {0}";
|
||||||
|
IndieLicenseMessage = " 独立开发者许可证已激活";
|
||||||
|
LicenseRenewalMessage = "许可证将于 {0} 续订。";
|
||||||
|
BusinessLicenseMessage = " 商业许可证已激活";
|
||||||
|
|
||||||
|
// Startup Messages
|
||||||
|
StartingHotReloadMessage = "正在启动 Hot Reload";
|
||||||
|
|
||||||
|
// Overlay
|
||||||
|
OverlayPanelName = "Hot Reload 指示";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 84e781692dea7c94f8da7bd64dfbfceb
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
namespace SingularityGroup.HotReload.Editor.Localization {
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Utility {
|
||||||
|
// Compilation and Assembly
|
||||||
|
public static string CompileError;
|
||||||
|
public static string UnsupportedChange;
|
||||||
|
public static string AssemblyFileEditError;
|
||||||
|
public static string NativePluginEditError;
|
||||||
|
public static string InspectorFieldChangeError;
|
||||||
|
|
||||||
|
// Version and Project
|
||||||
|
public static string InvalidVersionNoMinor;
|
||||||
|
public static string InvalidVersionNoPatch;
|
||||||
|
public static string FailedCreateCSharpProject;
|
||||||
|
public static string ApplicationNotFound;
|
||||||
|
|
||||||
|
// Download and Installation
|
||||||
|
public static string StreamHasToBeReadable;
|
||||||
|
public static string StreamHasToBeWritable;
|
||||||
|
public static string UnableToLocateServer;
|
||||||
|
public static string UnableToLocateServerDetail;
|
||||||
|
public static string CannotFindSolutionFile;
|
||||||
|
public static string UnableToUpdatePackageDifferentDrive;
|
||||||
|
public static string UnableToLocateHotReloadPackage;
|
||||||
|
|
||||||
|
// CLI and Build
|
||||||
|
public static string FailedLocatingServer;
|
||||||
|
public static string PreparingBuildInfoFailed;
|
||||||
|
|
||||||
|
// Logs
|
||||||
|
public static string PlayerAssemblyDebug;
|
||||||
|
|
||||||
|
// Symbols
|
||||||
|
public static string GenericParameterMismatch;
|
||||||
|
public static string GenericParameterTypeDefinitionMismatch;
|
||||||
|
|
||||||
|
// Method Compatibility
|
||||||
|
public static string MethodCallWarning;
|
||||||
|
public static string OnHotReloadLocalWarning;
|
||||||
|
public static string OnHotReloadWarning;
|
||||||
|
public static string OnHotReloadLocalCallWarning;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
CompileError = "Compile error";
|
||||||
|
UnsupportedChange = "Unsupported change";
|
||||||
|
AssemblyFileEditError = "errors: AssemblyFileEdit: Editing assembly files requires recompiling in Unity. in {0}";
|
||||||
|
NativePluginEditError = "errors: NativePluginEdit: Editing native plugins requires recompiling in Unity. in {0}";
|
||||||
|
InspectorFieldChangeError = "errors: Some inspector field changes require recompilation in Unity. Auto recompiling Unity according to the settings.";
|
||||||
|
|
||||||
|
InvalidVersionNoMinor = "Invalid version (no minor version given in strict mode)";
|
||||||
|
InvalidVersionNoPatch = "Invalid version (no patch version given in strict mode)";
|
||||||
|
FailedCreateCSharpProject = "Failed creating c# project because the c# project header did not have the correct amount of arguments, which is {0}";
|
||||||
|
ApplicationNotFound = "Application not found";
|
||||||
|
|
||||||
|
StreamHasToBeReadable = "Has to be readable";
|
||||||
|
StreamHasToBeWritable = "Has to be writable";
|
||||||
|
UnableToLocateServer = "Unable to locate the 'Server' directory. ";
|
||||||
|
UnableToLocateServerDetail = "Make sure the 'Server' directory is somewhere in the Assets folder inside a 'HotReload' folder or in the HotReload package";
|
||||||
|
CannotFindSolutionFile = "Cannot find solution file. Please disable \"useBuiltInProjectGeneration\" in settings to enable custom project generation.";
|
||||||
|
UnableToUpdatePackageDifferentDrive = "unable to update package because it is located on a different drive than the unity project";
|
||||||
|
UnableToLocateHotReloadPackage = "unable to locate hot reload package";
|
||||||
|
|
||||||
|
FailedLocatingServer = "Failed to locate Hot Reload server directory";
|
||||||
|
PreparingBuildInfoFailed = "Preparing build info failed! On-device functionality might not work. Exception: {0}";
|
||||||
|
|
||||||
|
PlayerAssemblyDebug = "player assembly named {0}";
|
||||||
|
|
||||||
|
GenericParameterMismatch = "Generic parameter did not resolve to generic type definition";
|
||||||
|
GenericParameterTypeDefinitionMismatch = "Generic parameter did not exist on the generic type definition";
|
||||||
|
|
||||||
|
MethodCallWarning = "failed. Make sure it's a method with 0 parameters either static or defined on MonoBehaviour.";
|
||||||
|
OnHotReloadLocalWarning = "failed to find method {0}. Make sure it exists within the same class.";
|
||||||
|
OnHotReloadWarning = "failed. Make sure it has 0 parameters, or 1 parameter with type List<MethodPatch>. Exception:";
|
||||||
|
OnHotReloadLocalCallWarning = "failed. Make sure it has 0 parameters. Exception:";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
CompileError = "编译错误";
|
||||||
|
UnsupportedChange = "不支持的更改";
|
||||||
|
AssemblyFileEditError = "错误:AssemblyFileEdit:编辑程序集文件需要在 Unity 中重新编译。在 {0} 中";
|
||||||
|
NativePluginEditError = "错误:NativePluginEdit:编辑本机插件需要在 Unity 中重新编译。在 {0} 中";
|
||||||
|
InspectorFieldChangeError = "错误:一些检查器字段更改需要在 Unity 中重新编译。根据设置自动重新编译 Unity。";
|
||||||
|
|
||||||
|
InvalidVersionNoMinor = "无效版本(严格模式下未提供次要版本)";
|
||||||
|
InvalidVersionNoPatch = "无效版本(严格模式下未提供补丁版本)";
|
||||||
|
FailedCreateCSharpProject = "创建 C# 项目失败,因为 C# 项目头没有正确的参数数量,即 {0}";
|
||||||
|
ApplicationNotFound = "未找到应用程序";
|
||||||
|
|
||||||
|
StreamHasToBeReadable = "必须可读";
|
||||||
|
StreamHasToBeWritable = "必须可写";
|
||||||
|
UnableToLocateServer = "无法找到“服务器”目录。";
|
||||||
|
UnableToLocateServerDetail = "确保“服务器”目录位于 Assets 文件夹内的“HotReload”文件夹中,或在 HotReload 包中";
|
||||||
|
CannotFindSolutionFile = "找不到解决方案文件。请在设置中禁用“useBuiltInProjectGeneration”以启用自定义项目生成。";
|
||||||
|
UnableToUpdatePackageDifferentDrive = "无法更新包,因为它位于与 unity 项目不同的驱动器上";
|
||||||
|
UnableToLocateHotReloadPackage = "无法找到 hot reload 包";
|
||||||
|
|
||||||
|
FailedLocatingServer = "未能找到 Hot Reload 服务器目录";
|
||||||
|
PreparingBuildInfoFailed = "准备构建信息失败!设备上功能可能无法工作。异常:{0}";
|
||||||
|
|
||||||
|
PlayerAssemblyDebug = "名为 {0} 的播放器程序集";
|
||||||
|
|
||||||
|
GenericParameterMismatch = "泛型参数未解析为泛型类型定义";
|
||||||
|
GenericParameterTypeDefinitionMismatch = "泛型参数在泛型类型定义上不存在";
|
||||||
|
|
||||||
|
MethodCallWarning = "失败。请确保它是一个具有 0 个参数的方法,静态或在 MonoBehaviour 上定义。";
|
||||||
|
OnHotReloadLocalWarning = "未能找到方法 {0}。请确保它存在于同一个类中。";
|
||||||
|
OnHotReloadWarning = "失败。请确保它有 0 个参数,或 1 个类型为 List<MethodPatch> 的参数。异常:";
|
||||||
|
OnHotReloadLocalCallWarning = "失败。请确保它有 0 个参数。异常:";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c089e14ef1f6aa5438ecc4ea082be7d9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEditor.Android;
|
using UnityEditor.Android;
|
||||||
using UnityEditor.Build;
|
using UnityEditor.Build;
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
// Unity 2021 or older → put manifest flag in if Unity is making a Development Build
|
// Unity 2021 or older → put manifest flag in if Unity is making a Development Build
|
||||||
var manifestFilePath = FindAndroidManifest(path);
|
var manifestFilePath = FindAndroidManifest(path);
|
||||||
if (manifestFilePath == null) {
|
if (manifestFilePath == null) {
|
||||||
throw new BuildFailedException($"[{CodePatcher.TAG}] Unable to find {manifestFileName}");
|
throw new BuildFailedException(string.Format(Translations.Errors.ExceptionUnableToFindManifest, CodePatcher.TAG, manifestFileName));
|
||||||
}
|
}
|
||||||
SetUsesCleartextTraffic(manifestFilePath);
|
SetUsesCleartextTraffic(manifestFilePath);
|
||||||
#endif
|
#endif
|
||||||
@@ -91,7 +92,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
return manifestFilePath;
|
return manifestFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Info("Did not find {0} at {1}, searching for manifest file inside {2}", manifestFileName, manifestFilePath, dir.FullName);
|
Log.Info(Translations.Errors.InfoManifestSearch, manifestFileName, manifestFilePath, dir.FullName);
|
||||||
var manifestFiles = dir.GetFiles(manifestFileName, SearchOption.AllDirectories);
|
var manifestFiles = dir.GetFiles(manifestFileName, SearchOption.AllDirectories);
|
||||||
if (manifestFiles.Length == 0) {
|
if (manifestFiles.Length == 0) {
|
||||||
return null;
|
return null;
|
||||||
@@ -125,8 +126,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
@"<application\s",
|
@"<application\s",
|
||||||
"<application android:usesCleartextTraffic=\"true\" "
|
"<application android:usesCleartextTraffic=\"true\" "
|
||||||
);
|
);
|
||||||
newContents += $"\n<!-- [{CodePatcher.TAG}] Added android:usesCleartextTraffic=\"true\" to permit connecting to the Hot Reload http server running on your machine. -->";
|
newContents += $"\n<!-- {string.Format(Translations.Errors.CommentAndroidCleartextPermit, CodePatcher.TAG)} -->";
|
||||||
newContents += $"\n<!-- [{CodePatcher.TAG}] This change only happens in Unity development builds. You can disable this in the Hot Reload settings window. -->";
|
newContents += $"\n<!-- {string.Format(Translations.Errors.CommentAndroidCleartextDevelopmentOnly, CodePatcher.TAG)} -->";
|
||||||
File.WriteAllText(manifestFilePath, newContents);
|
File.WriteAllText(manifestFilePath, newContents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Build;
|
using UnityEditor.Build;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
/// <summary>Includes HotReload Resources only in development builds</summary>
|
/// <summary>Includes HotReload Resources only in development builds</summary>
|
||||||
@@ -47,7 +48,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
public void OnPostprocessBuild(BuildTarget target, string path) {
|
public void OnPostprocessBuild(BuildTarget target, string path) {
|
||||||
if (warnSettingsNotSupported) {
|
if (warnSettingsNotSupported) {
|
||||||
Debug.LogWarning("Hot Reload was not included in the build because one or more build settings were not supported.");
|
Debug.LogWarning(Translations.Errors.WarningBuildSettingsNotSupported);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SingularityGroup.HotReload;
|
using SingularityGroup.HotReload;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using SingularityGroup.HotReload.Editor.Util;
|
using SingularityGroup.HotReload.Editor.Util;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
@@ -275,7 +276,7 @@ namespace SingularityGroup.HotReload.Editor.ProjectGeneration {
|
|||||||
try {
|
try {
|
||||||
pp.OnGeneratedCSProjectFilesThreaded();
|
pp.OnGeneratedCSProjectFilesThreaded();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.Warning("Post processor '{0}' threw exception when calling OnGeneratedCSProjectFilesThreaded:\n{1}", pp, ex);
|
Log.Warning(Translations.Errors.WarningPostProcessorException, pp, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,7 +298,7 @@ namespace SingularityGroup.HotReload.Editor.ProjectGeneration {
|
|||||||
try {
|
try {
|
||||||
newContents = pp.OnGeneratedCSProjectThreaded(path, newContents);
|
newContents = pp.OnGeneratedCSProjectThreaded(path, newContents);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.Warning("Post processor '{0}' failed when processing project '{1}':\n{2}", pp, path, ex);
|
Log.Warning(Translations.Errors.WarningPostProcessorFailedProject, pp, path, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +310,7 @@ namespace SingularityGroup.HotReload.Editor.ProjectGeneration {
|
|||||||
try {
|
try {
|
||||||
newContents = pp.OnGeneratedSlnSolutionThreaded(path, newContents);
|
newContents = pp.OnGeneratedSlnSolutionThreaded(path, newContents);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.Warning("Post processor '{0}' failed when processing solution '{1}':\n{2}", pp, path, ex);
|
Log.Warning(Translations.Errors.WarningPostProcessorFailedSolution, pp, path, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,8 +426,7 @@ namespace SingularityGroup.HotReload.Editor.ProjectGeneration {
|
|||||||
return string.Format(GetProjectHeaderTemplate(), arguments);
|
return string.Format(GetProjectHeaderTemplate(), arguments);
|
||||||
} catch (Exception) {
|
} catch (Exception) {
|
||||||
throw new NotSupportedException(
|
throw new NotSupportedException(
|
||||||
"Failed creating c# project because the c# project header did not have the correct amount of arguments, which is " +
|
string.Format(Translations.Utility.FailedCreateCSharpProject, arguments.Length));
|
||||||
arguments.Length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -849,11 +849,11 @@ namespace SingularityGroup.HotReload.Editor.ProjectGeneration {
|
|||||||
var instance = (IHotReloadProjectGenerationPostProcessor)Activator.CreateInstance(type);
|
var instance = (IHotReloadProjectGenerationPostProcessor)Activator.CreateInstance(type);
|
||||||
postProcessors.Add(instance);
|
postProcessors.Add(instance);
|
||||||
} catch (MissingMethodException) {
|
} catch (MissingMethodException) {
|
||||||
Log.Warning("The type '{0}' was expected to have a public default constructor but it didn't", type.FullName);
|
Log.Warning(Translations.Errors.WarningPostProcessorNoDefaultConstructor, type.FullName);
|
||||||
} catch (TargetInvocationException ex) {
|
} catch (TargetInvocationException ex) {
|
||||||
Log.Warning("Exception occurred when invoking default constructor of '{0}':\n{1}", type.FullName, ex.InnerException);
|
Log.Warning(Translations.Errors.WarningPostProcessorConstructorException, type.FullName, ex.InnerException);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.Warning("Unknown exception encountered when trying to create post processor '{0}':\n{1}", type.FullName, ex);
|
Log.Warning(Translations.Errors.WarningPostProcessorUnknownException, type.FullName, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ namespace SingularityGroup.HotReload.Editor.ProjectGeneration
|
|||||||
foreach (var error in responseFilesWithErrors)
|
foreach (var error in responseFilesWithErrors)
|
||||||
foreach (var valueError in error.Value.Errors)
|
foreach (var valueError in error.Value.Errors)
|
||||||
{
|
{
|
||||||
Log.Error("{0} Parse Error : {1}", error.Key, valueError);
|
Log.Error(Translations.Errors.ErrorParseError, error.Key, valueError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using SingularityGroup.HotReload.HarmonyLib;
|
using SingularityGroup.HotReload.HarmonyLib;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
@@ -231,7 +232,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
DetourApi.DetourMethod(original, replacement, out result);
|
DetourApi.DetourMethod(original, replacement, out result);
|
||||||
|
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
Debug.LogWarning($"Detouring {original.Name} method failed. {result.exception?.GetType()} {result.exception}");
|
Debug.LogWarning(string.Format(Translations.Errors.DebugDetouringMethodFailed, original.Name, result.exception?.GetType(), result.exception));
|
||||||
} else {
|
} else {
|
||||||
reverters.Add(result.patchRecord);
|
reverters.Add(result.patchRecord);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -4,12 +4,15 @@ using System.Net;
|
|||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
using SingularityGroup.HotReload.Editor.Semver;
|
using SingularityGroup.HotReload.Editor.Semver;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json.Linq;
|
using SingularityGroup.HotReload.Newtonsoft.Json.Linq;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
|
using Translations = SingularityGroup.HotReload.Editor.Localization.Translations;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal class PackageUpdateChecker {
|
internal class PackageUpdateChecker {
|
||||||
@@ -41,7 +44,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
Log.Warning("encountered exception when checking for new Hot Reload package version:\n{0}", ex);
|
Log.Warning(Translations.Errors.WarningVersionCheckException, ex);
|
||||||
}
|
}
|
||||||
await Task.Delay(RetryInterval);
|
await Task.Delay(RetryInterval);
|
||||||
}
|
}
|
||||||
@@ -72,7 +75,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if(response.statusCode == 0 || response.statusCode == 404) {
|
if(response.statusCode == 0 || response.statusCode == 404) {
|
||||||
// probably no internet, fail silently and retry
|
// probably no internet, fail silently and retry
|
||||||
} else if (!warnedVersionCheckFailed) {
|
} else if (!warnedVersionCheckFailed) {
|
||||||
Log.Warning("version check failed: {0}", response.err);
|
Log.Warning(Translations.Errors.WarningVersionCheckFailed, response.err);
|
||||||
warnedVersionCheckFailed = true;
|
warnedVersionCheckFailed = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -116,7 +119,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
static async Task<Response<SemVersion>> GetLatestPackageVersion() {
|
static async Task<Response<SemVersion>> GetLatestPackageVersion() {
|
||||||
string versionUrl;
|
string versionUrl;
|
||||||
|
|
||||||
if (PackageConst.IsAssetStoreBuild) {
|
if (PackageConst.DefaultLocaleField == Locale.SimplifiedChinese) {
|
||||||
|
versionUrl = "https://d2tc55zjhw51ly.cloudfront.net/releases/latest/asset-store-version-zh.json";
|
||||||
|
} else if (PackageConst.IsAssetStoreBuild) {
|
||||||
// version updates are synced with asset store
|
// version updates are synced with asset store
|
||||||
versionUrl = "https://d2tc55zjhw51ly.cloudfront.net/releases/latest/asset-store-version.json";
|
versionUrl = "https://d2tc55zjhw51ly.cloudfront.net/releases/latest/asset-store-version.json";
|
||||||
} else {
|
} else {
|
||||||
@@ -125,7 +130,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
try {
|
try {
|
||||||
using(var resp = await client.GetAsync(versionUrl).ConfigureAwait(false)) {
|
using(var resp = await client.GetAsync(versionUrl).ConfigureAwait(false)) {
|
||||||
if(resp.StatusCode != HttpStatusCode.OK) {
|
if(resp.StatusCode != HttpStatusCode.OK) {
|
||||||
return Response.FromError<SemVersion>($"Request failed with statusCode: {resp.StatusCode} {resp.ReasonPhrase}");
|
return Response.FromError<SemVersion>(string.Format(Translations.Errors.ErrorRequestFailedStatusCode, resp.StatusCode, resp.ReasonPhrase));
|
||||||
}
|
}
|
||||||
|
|
||||||
var json = await resp.Content.ReadAsStringAsync().ConfigureAwait(false);
|
var json = await resp.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||||
@@ -133,9 +138,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
SemVersion newVersion;
|
SemVersion newVersion;
|
||||||
JToken value;
|
JToken value;
|
||||||
if (!o.TryGetValue("version", out value)) {
|
if (!o.TryGetValue("version", out value)) {
|
||||||
return Response.FromError<SemVersion>("Invalid package.json");
|
return Response.FromError<SemVersion>(Translations.Errors.ErrorInvalidPackageJson);
|
||||||
} else if(!SemVersion.TryParse(value.Value<string>(), out newVersion, strict: true)) {
|
} else if(!SemVersion.TryParse(value.Value<string>(), out newVersion, strict: true)) {
|
||||||
return Response.FromError<SemVersion>($"Invalid version in package.json: '{value.Value<string>()}'");
|
return Response.FromError<SemVersion>(string.Format(Translations.Errors.ErrorInvalidVersionInPackageJson, value.Value<string>()));
|
||||||
} else {
|
} else {
|
||||||
return Response.FromResult(newVersion);
|
return Response.FromResult(newVersion);
|
||||||
}
|
}
|
||||||
@@ -147,7 +152,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
public async Task UpdatePackageAsync(SemVersion newVersion) {
|
public async Task UpdatePackageAsync(SemVersion newVersion) {
|
||||||
//Package can be updated by updating the git url via the package manager
|
//Package can be updated by updating the git url via the package manager
|
||||||
if(EditorUtility.DisplayDialog($"Update To v{newVersion}", $"By pressing 'Update' the Hot Reload package will be updated to v{newVersion}", "Update", "Cancel")) {
|
if(EditorUtility.DisplayDialog(string.Format(Translations.Dialogs.DialogTitleUpdateFormat, newVersion), string.Format(Translations.Dialogs.DialogMessageUpdateFormat, newVersion), Translations.Dialogs.DialogButtonUpdate, Translations.Common.ButtonCancel)) {
|
||||||
var resp = await GetLatestPackageVersion();
|
var resp = await GetLatestPackageVersion();
|
||||||
if(resp.err == null && resp.data > newVersion) {
|
if(resp.err == null && resp.data > newVersion) {
|
||||||
newVersion = resp.data;
|
newVersion = resp.data;
|
||||||
@@ -156,7 +161,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if(await IsUsingGitRepo()) {
|
if(await IsUsingGitRepo()) {
|
||||||
var err = UpdateGitUrlInManifest(newVersion);
|
var err = UpdateGitUrlInManifest(newVersion);
|
||||||
if(err != null) {
|
if(err != null) {
|
||||||
Log.Warning("Encountered issue when updating Hot Reload: {0}", err);
|
Log.Warning(Translations.Errors.WarningUpdateIssueFailed, err);
|
||||||
} else {
|
} else {
|
||||||
//Delete state to force another version check after the package is installed
|
//Delete state to force another version check after the package is installed
|
||||||
File.Delete(persistedFile);
|
File.Delete(persistedFile);
|
||||||
@@ -170,7 +175,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
} else {
|
} else {
|
||||||
var err = await UpdateUtility.Update(newVersion.ToString(), null, CancellationToken.None);
|
var err = await UpdateUtility.Update(newVersion.ToString(), null, CancellationToken.None);
|
||||||
if(err != null) {
|
if(err != null) {
|
||||||
Log.Warning("Failed to update package: {0}", err);
|
Log.Warning(Translations.Errors.WarningUpdatePackageFailed, err);
|
||||||
} else {
|
} else {
|
||||||
CompileMethodDetourer.Reset();
|
CompileMethodDetourer.Reset();
|
||||||
AssetDatabase.Refresh();
|
AssetDatabase.Refresh();
|
||||||
@@ -188,7 +193,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
const string manifestJsonPath = "Packages/manifest.json";
|
const string manifestJsonPath = "Packages/manifest.json";
|
||||||
var repoUrlToNewVersion = $"{repoUrl}#{newVersion}";
|
var repoUrlToNewVersion = $"{repoUrl}#{newVersion}";
|
||||||
if(!File.Exists(manifestJsonPath)) {
|
if(!File.Exists(manifestJsonPath)) {
|
||||||
return "Unable to find manifest.json";
|
return Translations.Errors.ErrorUnableToFindManifestJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
var root = JObject.Load(new JsonTextReader(new StringReader(File.ReadAllText(manifestJsonPath))));
|
var root = JObject.Load(new JsonTextReader(new StringReader(File.ReadAllText(manifestJsonPath))));
|
||||||
@@ -207,11 +212,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
JToken value;
|
JToken value;
|
||||||
if(!root.TryGetValue("dependencies", out value)) {
|
if(!root.TryGetValue("dependencies", out value)) {
|
||||||
deps = null;
|
deps = null;
|
||||||
return "no dependencies object found in manifest.json";
|
return Translations.Errors.ErrorNoDependenciesInManifest;
|
||||||
}
|
}
|
||||||
deps = value.Value<JObject>();
|
deps = value.Value<JObject>();
|
||||||
if(deps == null) {
|
if(deps == null) {
|
||||||
return "dependencies object null in manifest.json";
|
return Translations.Errors.ErrorDependenciesNullInManifest;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -219,7 +224,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
static async Task<bool> IsUsingGitRepo() {
|
static async Task<bool> IsUsingGitRepo() {
|
||||||
var respose = await Task.Run(() => IsUsingGitRepoThreaded(PackageConst.PackageName));
|
var respose = await Task.Run(() => IsUsingGitRepoThreaded(PackageConst.PackageName));
|
||||||
if(respose.err != null) {
|
if(respose.err != null) {
|
||||||
Log.Warning("Unable to find package. message: {0}", respose.err);
|
Log.Warning(Translations.Errors.WarningUnableToFindPackage, respose.err);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return respose.data;
|
return respose.data;
|
||||||
@@ -229,7 +234,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
static Response<bool> IsUsingGitRepoThreaded(string packageId) {
|
static Response<bool> IsUsingGitRepoThreaded(string packageId) {
|
||||||
var fi = new FileInfo("Packages/manifest.json");
|
var fi = new FileInfo("Packages/manifest.json");
|
||||||
if(!fi.Exists) {
|
if(!fi.Exists) {
|
||||||
return "Unable to find manifest.json";
|
return Translations.Errors.ErrorUnableToFindManifestJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
using(var reader = fi.OpenText()) {
|
using(var reader = fi.OpenText()) {
|
||||||
@@ -237,7 +242,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
JObject deps;
|
JObject deps;
|
||||||
var err = TryGetManfestDeps(root, out deps);
|
var err = TryGetManfestDeps(root, out deps);
|
||||||
if(err != null) {
|
if(err != null) {
|
||||||
return "no dependencies specified in manifest.json";
|
return Translations.Errors.ErrorNoDependenciesSpecified;
|
||||||
}
|
}
|
||||||
JToken value;
|
JToken value;
|
||||||
if(!deps.TryGetValue(packageId, out value)) {
|
if(!deps.TryGetValue(packageId, out value)) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Runtime.Serialization;
|
|||||||
using System.Security.Permissions;
|
using System.Security.Permissions;
|
||||||
#endif
|
#endif
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor.Semver
|
namespace SingularityGroup.HotReload.Editor.Semver
|
||||||
{
|
{
|
||||||
@@ -132,7 +133,7 @@ namespace SingularityGroup.HotReload.Editor.Semver
|
|||||||
}
|
}
|
||||||
else if (strict)
|
else if (strict)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("Invalid version (no minor version given in strict mode)");
|
throw new InvalidOperationException(Translations.Utility.InvalidVersionNoMinor);
|
||||||
}
|
}
|
||||||
|
|
||||||
var patchMatch = match.Groups["patch"];
|
var patchMatch = match.Groups["patch"];
|
||||||
@@ -147,7 +148,7 @@ namespace SingularityGroup.HotReload.Editor.Semver
|
|||||||
}
|
}
|
||||||
else if (strict)
|
else if (strict)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("Invalid version (no patch version given in strict mode)");
|
throw new InvalidOperationException(Translations.Utility.InvalidVersionNoPatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
var prerelease = match.Groups["pre"].Value;
|
var prerelease = match.Groups["pre"].Value;
|
||||||
@@ -267,10 +268,10 @@ namespace SingularityGroup.HotReload.Editor.Semver
|
|||||||
public string Build { get; private set; }
|
public string Build { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a <see cref="System.String" /> that represents this instance.
|
/// Returns a <see cref="string" /> that represents this instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// A <see cref="System.String" /> that represents this instance.
|
/// A <see cref="string" /> that represents this instance.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using UnityEditor;
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal class AllowAndroidAppToMakeHttpRequestsOption : ProjectOptionBase {
|
internal class AllowAndroidAppToMakeHttpRequestsOption : ProjectOptionBase {
|
||||||
public override string ShortSummary {
|
public override string ShortSummary {
|
||||||
get {
|
get {
|
||||||
return "Allow app to make HTTP requests";
|
return Translations.Settings.OptionAllowHttpRequests;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void InnerOnGUI(SerializedObject so) {
|
public override void InnerOnGUI(SerializedObject so) {
|
||||||
var description = "For Hot Reload to work on-device, please allow HTTP requests";
|
var description = Translations.Settings.OptionAllowHttpRequestsDescription;
|
||||||
EditorGUILayout.LabelField(description, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(description, HotReloadWindowStyles.WrapStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SingularityGroup.HotReload.Editor.Cli;
|
using SingularityGroup.HotReload.Editor.Cli;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal sealed class ExposeServerOption : ComputerOptionBase {
|
internal sealed class ExposeServerOption : ComputerOptionBase {
|
||||||
|
|
||||||
public override string ShortSummary => "Allow Devices to Connect";
|
public override string ShortSummary => Translations.Settings.OptionExposeServerShort;
|
||||||
public override string Summary => "Allow Devices to Connect (WiFi)";
|
public override string Summary => Translations.Settings.OptionExposeServerFull;
|
||||||
|
|
||||||
public override void InnerOnGUI() {
|
public override void InnerOnGUI() {
|
||||||
string description;
|
string description;
|
||||||
if (GetValue()) {
|
if (GetValue()) {
|
||||||
description = "The HotReload server is reachable from devices on the same Wifi network";
|
description = Translations.Settings.OptionExposeServerDescriptionEnabled;
|
||||||
} else {
|
} else {
|
||||||
description = "The HotReload server is available to your computer only. Other devices cannot connect to it.";
|
description = Translations.Settings.OptionExposeServerDescriptionDisabled;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(description, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(description, HotReloadWindowStyles.WrapStyle);
|
||||||
}
|
}
|
||||||
@@ -38,10 +39,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
RunOnMainThreadSync(() => {
|
RunOnMainThreadSync(() => {
|
||||||
var isRunningResult = ServerHealthCheck.I.IsServerHealthy;
|
var isRunningResult = ServerHealthCheck.I.IsServerHealthy;
|
||||||
if (isRunningResult) {
|
if (isRunningResult) {
|
||||||
var restartServer = EditorUtility.DisplayDialog("Hot Reload",
|
var restartServer = EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleHotReload,
|
||||||
$"When changing '{Summary}', the Hot Reload server must be restarted for this to take effect." +
|
string.Format(Translations.Dialogs.DialogMessageRestartExposeServer, Summary),
|
||||||
"\nDo you want to restart it now?",
|
Translations.Dialogs.DialogButtonRestartServer, Translations.Dialogs.DialogButtonDontRestart);
|
||||||
"Restart server", "Don't restart");
|
|
||||||
if (restartServer) {
|
if (restartServer) {
|
||||||
CodePatcher.I.ClearPatchedMethods();
|
CodePatcher.I.ClearPatchedMethods();
|
||||||
EditorCodePatcher.RestartCodePatcher().Forget();
|
EditorCodePatcher.RestartCodePatcher().Forget();
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using UnityEditor;
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal class IncludeInBuildOption : ProjectOptionBase, ISerializedProjectOption {
|
internal class IncludeInBuildOption : ProjectOptionBase, ISerializedProjectOption {
|
||||||
static IncludeInBuildOption _I;
|
static IncludeInBuildOption _I;
|
||||||
public static IncludeInBuildOption I = _I ?? (_I = new IncludeInBuildOption());
|
public static IncludeInBuildOption I = _I ?? (_I = new IncludeInBuildOption());
|
||||||
public override string ShortSummary => "Include Hot Reload in player builds";
|
public override string ShortSummary => Translations.Settings.OptionIncludeInBuild;
|
||||||
public override string Summary => ShortSummary;
|
public override string Summary => ShortSummary;
|
||||||
|
|
||||||
public override string ObjectPropertyName =>
|
public override string ObjectPropertyName =>
|
||||||
@@ -13,11 +14,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
public override void InnerOnGUI(SerializedObject so) {
|
public override void InnerOnGUI(SerializedObject so) {
|
||||||
string description;
|
string description;
|
||||||
if (GetValue(so)) {
|
if (GetValue(so)) {
|
||||||
description = "The Hot Reload runtime is included in development builds that use the Mono scripting backend.";
|
description = Translations.Settings.OptionIncludeInBuildDescriptionEnabled;
|
||||||
} else {
|
} else {
|
||||||
description = "The Hot Reload runtime will not be included in any build. Use this option to disable HotReload without removing it from your project.";
|
description = Translations.Settings.OptionIncludeInBuildDescriptionDisabled;
|
||||||
}
|
}
|
||||||
description += " This option does not affect Hot Reload usage in Playmode";
|
description += Translations.Settings.OptionIncludeInBuildDescriptionSuffix;
|
||||||
EditorGUILayout.LabelField(description, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(description, HotReloadWindowStyles.WrapStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Net.Http;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SingularityGroup.HotReload.DTO;
|
using SingularityGroup.HotReload.DTO;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using SingularityGroup.HotReload.Newtonsoft.Json;
|
using SingularityGroup.HotReload.Newtonsoft.Json;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -44,7 +45,6 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
const string statusSuccess = "success";
|
const string statusSuccess = "success";
|
||||||
const string statusAlreadyClaimed = "already redeemed by this user/device";
|
const string statusAlreadyClaimed = "already redeemed by this user/device";
|
||||||
const string unknownError = "We apologize, an error happened while redeeming your license. Please reach out to customer support for assistance.";
|
|
||||||
|
|
||||||
private GUILayoutOption[] secondaryButtonLayoutOptions = new[] { GUILayout.MaxWidth(100) };
|
private GUILayoutOption[] secondaryButtonLayoutOptions = new[] { GUILayout.MaxWidth(100) };
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.Warning($"Failed determining registration outcome with {e.GetType().Name}: {e.Message}");
|
Log.Warning(Translations.Errors.WarningFailedDeterminingRegistration, e.GetType().Name, e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,8 +80,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
private void RenderRegistration() {
|
private void RenderRegistration() {
|
||||||
var message = PackageConst.IsAssetStoreBuild
|
var message = PackageConst.IsAssetStoreBuild
|
||||||
? "Unity Pro users are required to obtain an additional license. You are eligible to redeem one if your company has ten or fewer employees. Please enter your company details below."
|
? Translations.Registration.MessageRegistrationProUsers
|
||||||
: "The licensing model for Unity Pro users varies depending on the number of employees in your company. Please enter your company details below.";
|
: Translations.Registration.MessageRegistrationLicensingModel;
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
EditorGUILayout.HelpBox(error, MessageType.Warning);
|
EditorGUILayout.HelpBox(error, MessageType.Warning);
|
||||||
} else {
|
} else {
|
||||||
@@ -90,15 +90,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
EditorGUILayout.LabelField("Company size (number of employees)");
|
EditorGUILayout.LabelField(Translations.Common.LabelCompanySize);
|
||||||
GUI.SetNextControlName("company_size");
|
GUI.SetNextControlName("company_size");
|
||||||
_pendingCompanySize = EditorGUILayout.TextField(_pendingCompanySize)?.Trim();
|
_pendingCompanySize = EditorGUILayout.TextField(_pendingCompanySize)?.Trim();
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
if (GUILayout.Button("Proceed")) {
|
if (GUILayout.Button(Translations.Common.ButtonProceed)) {
|
||||||
int companySize;
|
int companySize;
|
||||||
if (!int.TryParse(_pendingCompanySize, out companySize)) {
|
if (!int.TryParse(_pendingCompanySize, out companySize)) {
|
||||||
error = "Please enter a number.";
|
error = Translations.Errors.ErrorEnterNumber;
|
||||||
} else {
|
} else {
|
||||||
error = null;
|
error = null;
|
||||||
HandleRegistration(companySize);
|
HandleRegistration(companySize);
|
||||||
@@ -123,23 +123,23 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (error != null) {
|
if (error != null) {
|
||||||
EditorGUILayout.HelpBox(error, MessageType.Warning);
|
EditorGUILayout.HelpBox(error, MessageType.Warning);
|
||||||
} else {
|
} else {
|
||||||
EditorGUILayout.HelpBox("To enable us to verify your purchase, please enter your invoice number/order ID. Additionally, provide the email address that you intend to use for managing your credentials.", MessageType.Info);
|
EditorGUILayout.HelpBox(Translations.Registration.MessageRedeemInstructions, MessageType.Info);
|
||||||
}
|
}
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
EditorGUILayout.LabelField("Invoice number/Order ID");
|
EditorGUILayout.LabelField(Translations.Common.LabelInvoiceNumber);
|
||||||
GUI.SetNextControlName("invoice_number");
|
GUI.SetNextControlName("invoice_number");
|
||||||
_pendingInvoiceNumber = EditorGUILayout.TextField(_pendingInvoiceNumber ?? HotReloadPrefs.RedeemLicenseInvoice)?.Trim();
|
_pendingInvoiceNumber = EditorGUILayout.TextField(_pendingInvoiceNumber ?? HotReloadPrefs.RedeemLicenseInvoice)?.Trim();
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
EditorGUILayout.LabelField("Email");
|
EditorGUILayout.LabelField(Translations.Common.LabelEmail);
|
||||||
GUI.SetNextControlName("email_redeem");
|
GUI.SetNextControlName("email_redeem");
|
||||||
_pendingRedeemEmail = EditorGUILayout.TextField(_pendingRedeemEmail ?? HotReloadPrefs.RedeemLicenseEmail);
|
_pendingRedeemEmail = EditorGUILayout.TextField(_pendingRedeemEmail ?? HotReloadPrefs.RedeemLicenseEmail);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
using (new EditorGUI.DisabledScope(requestingRedeem)) {
|
using (new EditorGUI.DisabledScope(requestingRedeem)) {
|
||||||
if (GUILayout.Button("Redeem", HotReloadRunTab.bigButtonHeight)) {
|
if (GUILayout.Button(Translations.Common.ButtonRedeem, HotReloadRunTab.bigButtonHeight)) {
|
||||||
RedeemLicense(email: _pendingRedeemEmail, invoiceNumber: _pendingInvoiceNumber).Forget();
|
RedeemLicense(email: _pendingRedeemEmail, invoiceNumber: _pendingInvoiceNumber).Forget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (GUILayout.Button("Skip", secondaryButtonLayoutOptions)) {
|
if (GUILayout.Button(Translations.Common.ButtonSkip, secondaryButtonLayoutOptions)) {
|
||||||
SwitchToStage(RedeemStage.Login);
|
SwitchToStage(RedeemStage.Login);
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
@@ -158,7 +158,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
async Task RedeemLicense(string email, string invoiceNumber) {
|
async Task RedeemLicense(string email, string invoiceNumber) {
|
||||||
string validationError;
|
string validationError;
|
||||||
if (string.IsNullOrEmpty(invoiceNumber)) {
|
if (string.IsNullOrEmpty(invoiceNumber)) {
|
||||||
validationError = "Please enter invoice number / order ID.";
|
validationError = Translations.Errors.ErrorEnterInvoiceNumber;
|
||||||
} else {
|
} else {
|
||||||
validationError = HotReloadRunTab.ValidateEmail(email);
|
validationError = HotReloadRunTab.ValidateEmail(email);
|
||||||
}
|
}
|
||||||
@@ -170,8 +170,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
status = resp?.status;
|
status = resp?.status;
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
if (status != statusSuccess && status != statusAlreadyClaimed) {
|
if (status != statusSuccess && status != statusAlreadyClaimed) {
|
||||||
Log.Error("Redeeming license failed: unknown status received");
|
Log.Error(Translations.Errors.WarningRedeemStatusUnknown);
|
||||||
error = unknownError;
|
error = Translations.Registration.UnknownRedeemError;
|
||||||
} else {
|
} else {
|
||||||
HotReloadPrefs.RedeemLicenseEmail = email;
|
HotReloadPrefs.RedeemLicenseEmail = email;
|
||||||
HotReloadPrefs.RedeemLicenseInvoice = invoiceNumber;
|
HotReloadPrefs.RedeemLicenseInvoice = invoiceNumber;
|
||||||
@@ -182,31 +182,31 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
SwitchToStage(RedeemStage.Login);
|
SwitchToStage(RedeemStage.Login);
|
||||||
}
|
}
|
||||||
} else if (resp?.error != null) {
|
} else if (resp?.error != null) {
|
||||||
Log.Warning($"Redeeming a license failed with error: {resp.error}");
|
Log.Warning(Translations.Errors.WarningRedeemingLicenseFailed, resp.error);
|
||||||
error = GetPrettyError(resp);
|
error = GetPrettyError(resp);
|
||||||
} else {
|
} else {
|
||||||
Log.Warning("Redeeming a license failed: uknown error encountered");
|
Log.Warning(Translations.Errors.WarningRedeemUnknownError);
|
||||||
error = unknownError;
|
error = Translations.Registration.UnknownRedeemError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string GetPrettyError(RedeemResponse response) {
|
string GetPrettyError(RedeemResponse response) {
|
||||||
var err = response?.error;
|
var err = response?.error;
|
||||||
if (err == null) {
|
if (err == null) {
|
||||||
return unknownError;
|
return Translations.Registration.UnknownRedeemError;
|
||||||
}
|
}
|
||||||
if (err.Contains("Invalid email")) {
|
if (err.Contains("Invalid email")) {
|
||||||
return "Please enter a valid email address.";
|
return Translations.Errors.ErrorInvalidEmailAddress;
|
||||||
} else if (err.Contains("License invoice already redeemed")) {
|
} else if (err.Contains("License invoice already redeemed")) {
|
||||||
return "The invoice number/order ID you're trying to use has already been applied to redeem a license. Please enter a different invoice number/order ID. If you have already redeemed a license for another email, you may proceed to the next step.";
|
return Translations.Errors.ErrorLicenseInvoiceRedeemed;
|
||||||
} else if (err.Contains("Different license already redeemed by given email")) {
|
} else if (err.Contains("Different license already redeemed by given email")) {
|
||||||
return "The provided email has already been used to redeem a license. If you have previously redeemed a license, you can proceed to the next step and use your existing credentials. If not, please input a different email address.";
|
return Translations.Errors.ErrorEmailAlreadyUsed;
|
||||||
} else if (err.Contains("Invoice not found")) {
|
} else if (err.Contains("Invoice not found")) {
|
||||||
return "The invoice was not found. Please ensure that you've entered the correct invoice number/order ID.";
|
return Translations.Errors.ErrorInvoiceNotFound;
|
||||||
} else if (err.Contains("Invoice refunded")) {
|
} else if (err.Contains("Invoice refunded")) {
|
||||||
return "The purchase has been refunded. Please enter a different invoice number/order ID.";
|
return Translations.Errors.ErrorInvoiceRefunded;
|
||||||
} else {
|
} else {
|
||||||
return unknownError;
|
return Translations.Registration.UnknownRedeemError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,17 +222,17 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
var content = new StringContent(JsonConvert.SerializeObject(input), Encoding.UTF8, "application/json");
|
var content = new StringContent(JsonConvert.SerializeObject(input), Encoding.UTF8, "application/json");
|
||||||
using (var resp = await redeemClient.PostAsync(redeemUrl, content, HotReloadWindow.Current.cancelToken).ConfigureAwait(false)) {
|
using (var resp = await redeemClient.PostAsync(redeemUrl, content, HotReloadWindow.Current.cancelToken).ConfigureAwait(false)) {
|
||||||
if (resp.StatusCode != HttpStatusCode.OK) {
|
if (resp.StatusCode != HttpStatusCode.OK) {
|
||||||
return new RedeemResponse(null, $"Redeem request failed. Status code: {(int)resp.StatusCode}, reason: {resp.ReasonPhrase}");
|
return new RedeemResponse(null, string.Format(Translations.Errors.ErrorRedeemRequestFailed, (int)resp.StatusCode, resp.ReasonPhrase));
|
||||||
}
|
}
|
||||||
var str = await resp.Content.ReadAsStringAsync().ConfigureAwait(false);
|
var str = await resp.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||||
try {
|
try {
|
||||||
return JsonConvert.DeserializeObject<RedeemResponse>(str);
|
return JsonConvert.DeserializeObject<RedeemResponse>(str);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return new RedeemResponse(null, $"Failed deserializing redeem response with exception: {ex.GetType().Name}: {ex.Message}");
|
return new RedeemResponse(null, string.Format(Translations.Errors.ErrorFailedDeserializingRedeem, ex.GetType().Name, ex.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (WebException ex) {
|
} catch (WebException ex) {
|
||||||
return new RedeemResponse(null, $"Redeeming license failed: WebException encountered {ex.Message}");
|
return new RedeemResponse(null, string.Format(Translations.Errors.ErrorRedeemingWebException, ex.Message));
|
||||||
} finally {
|
} finally {
|
||||||
requestingRedeem = false;
|
requestingRedeem = false;
|
||||||
}
|
}
|
||||||
@@ -250,9 +250,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
private void RenderLogin(HotReloadRunTabState state) {
|
private void RenderLogin(HotReloadRunTabState state) {
|
||||||
if (status == statusSuccess) {
|
if (status == statusSuccess) {
|
||||||
EditorGUILayout.HelpBox("Success! You will receive an email containing your license password shortly. Once you receive it, please enter the received password in the designated field below to complete your registration.", MessageType.Info);
|
EditorGUILayout.HelpBox(Translations.Registration.MessageRedeemSuccess, MessageType.Info);
|
||||||
} else if (status == statusAlreadyClaimed) {
|
} else if (status == statusAlreadyClaimed) {
|
||||||
EditorGUILayout.HelpBox("Your license has already been redeemed. Please enter your existing password below.", MessageType.Info);
|
EditorGUILayout.HelpBox(Translations.Registration.MessageRedeemAlreadyClaimed, MessageType.Info);
|
||||||
}
|
}
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
@@ -263,7 +263,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (GUILayout.Button("Go Back", secondaryButtonLayoutOptions)) {
|
if (GUILayout.Button(Translations.Common.ButtonGoBack, secondaryButtonLayoutOptions)) {
|
||||||
SwitchToStage(RedeemStage.Redeem);
|
SwitchToStage(RedeemStage.Redeem);
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.ComponentModel;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -35,12 +36,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal class HotReloadAboutTab : HotReloadTabBase {
|
internal class HotReloadAboutTab : HotReloadTabBase {
|
||||||
internal static readonly OpenURLButton seeMore = new OpenURLButton("See More", Constants.ChangelogURL);
|
internal static readonly OpenURLButton seeMore = new OpenURLButton(Translations.About.ButtonSeeMore, Constants.ChangelogURL);
|
||||||
internal static readonly OpenDialogueButton manageLicenseButton = new OpenDialogueButton("Manage License", Constants.ManageLicenseURL, "Manage License", "Upgrade/downgrade/edit your subscription and edit payment info.", "Open in browser", "Cancel");
|
internal static readonly OpenDialogueButton manageLicenseButton = new OpenDialogueButton(Translations.About.ButtonManageLicense, Constants.ManageLicenseURL, Translations.About.ButtonManageLicense, Translations.Dialogs.DialogManageLicenseMessage, Translations.Common.ButtonOpenInBrowser, Translations.Common.ButtonCancel);
|
||||||
internal static readonly OpenDialogueButton manageAccountButton = new OpenDialogueButton("Manage Account", Constants.ManageAccountURL, "Manage Account", "Login with company code 'naughtycult'. Use the email you signed up with. Your initial password was sent to you by email.", "Open in browser", "Cancel");
|
internal static readonly OpenDialogueButton manageAccountButton = new OpenDialogueButton(Translations.About.ButtonManageAccount, Constants.ManageAccountURL, Translations.About.ButtonManageAccount, Translations.Dialogs.DialogManageAccountMessage, Translations.Common.ButtonOpenInBrowser, Translations.Common.ButtonCancel);
|
||||||
internal static readonly OpenURLButton contactButton = new OpenURLButton("Contact", Constants.ContactURL);
|
internal static readonly OpenURLButton contactButton = new OpenURLButton(Translations.About.ButtonContact, Constants.ContactURL);
|
||||||
internal static readonly OpenURLButton discordButton = new OpenURLButton("Join Discord", Constants.DiscordInviteUrl);
|
internal static readonly OpenURLButton discordButton = new OpenURLButton(Translations.About.ButtonJoinDiscord, Constants.DiscordInviteUrl);
|
||||||
internal static readonly OpenDialogueButton reportIssueButton = new OpenDialogueButton("Report issue", Constants.ReportIssueURL, "Report issue", "Report issue in our public issue tracker. Requires gitlab.com account (if you don't have one and are not willing to make it, please contact us by other means such as our website).", "Open in browser", "Cancel");
|
internal static readonly OpenDialogueButton reportIssueButton = new OpenDialogueButton(Translations.About.ButtonReportIssue, Constants.ReportIssueURL, Translations.About.ButtonReportIssue, Translations.Dialogs.DialogReportIssueMessage, Translations.Common.ButtonOpenInBrowser, Translations.Common.ButtonCancel);
|
||||||
|
|
||||||
private Vector2 _changelogScroll;
|
private Vector2 _changelogScroll;
|
||||||
private IReadOnlyList<ChangelogVersion> _changelog = new List<ChangelogVersion>();
|
private IReadOnlyList<ChangelogVersion> _changelog = new List<ChangelogVersion>();
|
||||||
@@ -88,7 +89,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public HotReloadAboutTab(HotReloadWindow window) : base(window, "Help", "_Help", "Info and support for Hot Reload for Unity.") { }
|
public HotReloadAboutTab(HotReloadWindow window) : base(window, Translations.About.AboutTitle, "_Help", Translations.About.AboutDescription) { }
|
||||||
|
|
||||||
string GetRelativeDate(DateTime givenDate) {
|
string GetRelativeDate(DateTime givenDate) {
|
||||||
const int second = 1;
|
const int second = 1;
|
||||||
@@ -101,20 +102,20 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
var delta = Math.Abs(ts.TotalSeconds);
|
var delta = Math.Abs(ts.TotalSeconds);
|
||||||
|
|
||||||
if (delta < 24 * hour)
|
if (delta < 24 * hour)
|
||||||
return "Today";
|
return Translations.About.AboutToday;
|
||||||
|
|
||||||
if (delta < 48 * hour)
|
if (delta < 48 * hour)
|
||||||
return "Yesterday";
|
return Translations.About.AboutYesterday;
|
||||||
|
|
||||||
if (delta < 30 * day)
|
if (delta < 30 * day)
|
||||||
return ts.Days + " days ago";
|
return string.Format(Translations.About.AboutDaysAgo, ts.Days);
|
||||||
|
|
||||||
if (delta < 12 * month) {
|
if (delta < 12 * month) {
|
||||||
var months = Convert.ToInt32(Math.Floor((double)ts.Days / 30));
|
var months = Convert.ToInt32(Math.Floor((double)ts.Days / 30));
|
||||||
return months <= 1 ? "one month ago" : months + " months ago";
|
return months <= 1 ? Translations.About.AboutOneMonthAgo : string.Format(Translations.About.AboutMonthsAgo, months);
|
||||||
}
|
}
|
||||||
var years = Convert.ToInt32(Math.Floor((double)ts.Days / 365));
|
var years = Convert.ToInt32(Math.Floor((double)ts.Days / 365));
|
||||||
return years <= 1 ? "one year ago" : years + " years ago";
|
return years <= 1 ? Translations.About.AboutOneYearAgo : string.Format(Translations.About.AboutYearsAgo, years);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderVersion(ChangelogVersion version) {
|
void RenderVersion(ChangelogVersion version) {
|
||||||
@@ -130,7 +131,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
//features
|
//features
|
||||||
if (version.features != null) {
|
if (version.features != null) {
|
||||||
EditorGUILayout.TextArea("Features:", HotReloadWindowStyles.H2TitleStyle);
|
EditorGUILayout.TextArea(Translations.About.AboutFeatures, HotReloadWindowStyles.H2TitleStyle);
|
||||||
tempTextString = "";
|
tempTextString = "";
|
||||||
foreach (var feature in version.features) {
|
foreach (var feature in version.features) {
|
||||||
tempTextString += "• " + feature + "\n";
|
tempTextString += "• " + feature + "\n";
|
||||||
@@ -140,7 +141,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
//improvements
|
//improvements
|
||||||
if (version.improvements != null) {
|
if (version.improvements != null) {
|
||||||
EditorGUILayout.TextArea("Improvements:", HotReloadWindowStyles.H2TitleStyle);
|
EditorGUILayout.TextArea(Translations.About.AboutImprovements, HotReloadWindowStyles.H2TitleStyle);
|
||||||
tempTextString = "";
|
tempTextString = "";
|
||||||
foreach (var improvement in version.improvements) {
|
foreach (var improvement in version.improvements) {
|
||||||
tempTextString += "• " + improvement + "\n";
|
tempTextString += "• " + improvement + "\n";
|
||||||
@@ -150,7 +151,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
//fixes
|
//fixes
|
||||||
if (version.fixes != null) {
|
if (version.fixes != null) {
|
||||||
EditorGUILayout.TextArea("Fixes:", HotReloadWindowStyles.H2TitleStyle);
|
EditorGUILayout.TextArea(Translations.About.AboutFixes, HotReloadWindowStyles.H2TitleStyle);
|
||||||
tempTextString = "";
|
tempTextString = "";
|
||||||
foreach (var fix in version.fixes) {
|
foreach (var fix in version.fixes) {
|
||||||
tempTextString += "• " + fix + "\n";
|
tempTextString += "• " + fix + "\n";
|
||||||
@@ -170,7 +171,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
FetchChangelog().Forget();
|
FetchChangelog().Forget();
|
||||||
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionInnerBoxWide)) {
|
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionInnerBoxWide)) {
|
||||||
using (new EditorGUILayout.VerticalScope()) {
|
using (new EditorGUILayout.VerticalScope()) {
|
||||||
HotReloadPrefs.ShowChangeLog = EditorGUILayout.Foldout(HotReloadPrefs.ShowChangeLog, "Changelog", true, HotReloadWindowStyles.FoldoutStyle);
|
HotReloadPrefs.ShowChangeLog = EditorGUILayout.Foldout(HotReloadPrefs.ShowChangeLog, Translations.Miscellaneous.ChangelogTitle, true, HotReloadWindowStyles.FoldoutStyle);
|
||||||
if (!HotReloadPrefs.ShowChangeLog) {
|
if (!HotReloadPrefs.ShowChangeLog) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -224,7 +225,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
RenderLogButtons();
|
RenderLogButtons();
|
||||||
|
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
EditorGUILayout.HelpBox($" Hot Reload version {PackageConst.Version}. ", MessageType.Info);
|
EditorGUILayout.HelpBox(string.Format(Translations.About.AboutVersionInfo, PackageConst.Version), MessageType.Info);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
RenderHelpButtons();
|
RenderHelpButtons();
|
||||||
@@ -248,7 +249,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
var buttonHeight = 19;
|
var buttonHeight = 19;
|
||||||
|
|
||||||
var bigButtonRect = new Rect(labelRect.x + 3, labelRect.y + 5, labelRect.width - 6, buttonHeight);
|
var bigButtonRect = new Rect(labelRect.x + 3, labelRect.y + 5, labelRect.width - 6, buttonHeight);
|
||||||
OpenURLButton.RenderRaw(bigButtonRect, "Documentation", Constants.DocumentationURL, HotReloadWindowStyles.HelpTabButton);
|
OpenURLButton.RenderRaw(bigButtonRect, Translations.About.ButtonDocumentation, Constants.DocumentationURL, HotReloadWindowStyles.HelpTabButton);
|
||||||
|
|
||||||
var firstLayerX = bigButtonRect.x;
|
var firstLayerX = bigButtonRect.x;
|
||||||
var firstLayerY = bigButtonRect.y + buttonHeight + 3;
|
var firstLayerY = bigButtonRect.y + buttonHeight + 3;
|
||||||
@@ -260,7 +261,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
OpenURLButton.RenderRaw(new Rect { x = firstLayerX, y = firstLayerY, width = firstLayerWidth, height = buttonHeight }, contactButton.text, contactButton.url, HotReloadWindowStyles.HelpTabButton);
|
OpenURLButton.RenderRaw(new Rect { x = firstLayerX, y = firstLayerY, width = firstLayerWidth, height = buttonHeight }, contactButton.text, contactButton.url, HotReloadWindowStyles.HelpTabButton);
|
||||||
OpenURLButton.RenderRaw(new Rect { x = secondLayerX, y = firstLayerY, width = secondLayerWidth, height = buttonHeight }, "Unity Forum", Constants.ForumURL, HotReloadWindowStyles.HelpTabButton);
|
OpenURLButton.RenderRaw(new Rect { x = secondLayerX, y = firstLayerY, width = secondLayerWidth, height = buttonHeight }, Translations.About.ButtonUnityForum, Constants.ForumURL, HotReloadWindowStyles.HelpTabButton);
|
||||||
}
|
}
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
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);
|
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);
|
||||||
@@ -276,31 +277,32 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
EditorGUILayout.BeginHorizontal();
|
EditorGUILayout.BeginHorizontal();
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (GUILayout.Button("Open Log File")) {
|
if (GUILayout.Button(Translations.Common.ButtonOpenLogFile)) {
|
||||||
var mostRecentFile = LogsHelper.FindRecentLog(logsPath);
|
var mostRecentFile = LogsHelper.FindRecentLog(logsPath);
|
||||||
if (mostRecentFile == null) {
|
if (mostRecentFile == null) {
|
||||||
Log.Info("No logs found");
|
Log.Info(Translations.About.LogNoLogsFound);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Process.Start($"\"{Path.Combine(logsPath, mostRecentFile)}\"");
|
Process.Start($"\"{Path.Combine(logsPath, mostRecentFile)}\"");
|
||||||
} catch (Win32Exception e) {
|
} catch (Win32Exception e) {
|
||||||
|
// TODO: is this the same for chinese?
|
||||||
if (e.Message.Contains("Application not found")) {
|
if (e.Message.Contains("Application not found")) {
|
||||||
try {
|
try {
|
||||||
Process.Start("notepad.exe", $"\"{Path.Combine(logsPath, mostRecentFile)}\"");
|
Process.Start("notepad.exe", $"\"{Path.Combine(logsPath, mostRecentFile)}\"");
|
||||||
} catch {
|
} catch {
|
||||||
// Fallback to opening folder with all logs
|
// Fallback to opening folder with all logs
|
||||||
Process.Start($"\"{logsPath}\"");
|
Process.Start($"\"{logsPath}\"");
|
||||||
Log.Info("Failed opening log file.");
|
Log.Info(Translations.About.LogFailedOpeningLogFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// Fallback to opening folder with all logs
|
// Fallback to opening folder with all logs
|
||||||
Process.Start($"\"{logsPath}\"");
|
Process.Start($"\"{logsPath}\"");
|
||||||
Log.Info("Failed opening log file.");
|
Log.Info(Translations.About.LogFailedOpeningLogFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Browse all logs")) {
|
if (GUILayout.Button(Translations.Common.ButtonBrowseAllLogs)) {
|
||||||
Process.Start($"\"{logsPath}\"");
|
Process.Start($"\"{logsPath}\"");
|
||||||
}
|
}
|
||||||
EditorGUILayout.EndHorizontal();
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload.Editor {
|
namespace SingularityGroup.HotReload.Editor {
|
||||||
internal class HotReloadOptionsSection {
|
internal class HotReloadOptionsSection {
|
||||||
@@ -23,7 +24,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
// This does not save the asset, user has to do that by saving assets in Unity (e.g. press hotkey Ctrl + S)
|
// This does not save the asset, user has to do that by saving assets in Unity (e.g. press hotkey Ctrl + S)
|
||||||
var target = so.targetObject as HotReloadSettingsObject;
|
var target = so.targetObject as HotReloadSettingsObject;
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
Log.Warning("Unexpected problem unable to save HotReloadSettingsObject");
|
Log.Warning(Translations.Errors.WarningUnexpectedSaveProblem);
|
||||||
} else {
|
} else {
|
||||||
// when one of the project options changed then we ensure the asset file exists.
|
// when one of the project options changed then we ensure the asset file exists.
|
||||||
HotReloadSettingsEditor.EnsureSettingsCreated(target);
|
HotReloadSettingsEditor.EnsureSettingsCreated(target);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using SingularityGroup.HotReload.DTO;
|
using SingularityGroup.HotReload.DTO;
|
||||||
using SingularityGroup.HotReload.EditorDependencies;
|
using SingularityGroup.HotReload.EditorDependencies;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -51,12 +52,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
} catch {
|
} catch {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
fileName = fileName ?? "Tap to show stacktrace";
|
fileName = fileName ?? Translations.UI.TapToShowStacktrace;
|
||||||
|
|
||||||
// Get the error
|
// Get the error
|
||||||
string error = (errorString.Contains("error CS")
|
string error = (errorString.Contains("error CS")
|
||||||
? "Compile error, "
|
? Translations.UI.CompileErrorMessage + ", "
|
||||||
: "Unsupported change detected, ") + "tap here to see more.";
|
: Translations.UI.UnsupportedChangeMessage + ", ") + Translations.UI.TapHereToSeeMore;
|
||||||
int endOfError = errorString.IndexOf(". in ", StringComparison.Ordinal);
|
int endOfError = errorString.IndexOf(". in ", StringComparison.Ordinal);
|
||||||
string specialChars = "\"'/\\";
|
string specialChars = "\"'/\\";
|
||||||
char[] characters = specialChars.ToCharArray();
|
char[] characters = specialChars.ToCharArray();
|
||||||
@@ -258,7 +259,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
private MessageType promoCodeErrorType;
|
private MessageType promoCodeErrorType;
|
||||||
private bool promoCodeActivatedThisSession;
|
private bool promoCodeActivatedThisSession;
|
||||||
|
|
||||||
public HotReloadRunTab(HotReloadWindow window) : base(window, "Run", "forward", "Run and monitor the current Hot Reload session.") { }
|
public HotReloadRunTab(HotReloadWindow window) : base(window, Translations.UI.RunTabTitle, "forward", Translations.UI.RunTabTooltip) { }
|
||||||
|
|
||||||
public override void OnGUI() {
|
public override void OnGUI() {
|
||||||
using(new EditorGUILayout.VerticalScope()) {
|
using(new EditorGUILayout.VerticalScope()) {
|
||||||
@@ -405,7 +406,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
GUI.Label(startRect, new GUIContent(title, icon), style);
|
GUI.Label(startRect, new GUIContent(title, icon), style);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool clickableDescription = (alertEntry.title == "Unsupported change" || alertEntry.title == "Compile error" || alertEntry.title == "Failed applying patch to method") && alertEntry.alertData.alertEntryType != AlertEntryType.InlinedMethod;
|
bool clickableDescription = (alertEntry.title == Translations.Utility.UnsupportedChange || alertEntry.title == Translations.Utility.CompileError || alertEntry.title == Translations.Timeline.EventTitleFailedApplyingPatch) && alertEntry.alertData.alertEntryType != AlertEntryType.InlinedMethod;
|
||||||
|
|
||||||
if (HotReloadTimelineHelper.expandedEntries.Contains(alertEntry) || alertEntry.alertType == AlertType.CompileError) {
|
if (HotReloadTimelineHelper.expandedEntries.Contains(alertEntry) || alertEntry.alertType == AlertType.CompileError) {
|
||||||
using (new EditorGUILayout.VerticalScope()) {
|
using (new EditorGUILayout.VerticalScope()) {
|
||||||
@@ -504,7 +505,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
using (new EditorGUILayout.VerticalScope()) {
|
using (new EditorGUILayout.VerticalScope()) {
|
||||||
HotReloadPrefs.RunTabEventsSuggestionsFoldout = EditorGUILayout.Foldout(HotReloadPrefs.RunTabEventsSuggestionsFoldout, "", true, HotReloadWindowStyles.CustomFoldoutStyle);
|
HotReloadPrefs.RunTabEventsSuggestionsFoldout = EditorGUILayout.Foldout(HotReloadPrefs.RunTabEventsSuggestionsFoldout, "", true, HotReloadWindowStyles.CustomFoldoutStyle);
|
||||||
GUILayout.Space(-23);
|
GUILayout.Space(-23);
|
||||||
if (GUILayout.Button($"Suggestions ({currentState.suggestionCount.ToString()})", HotReloadWindowStyles.ClickableLabelBoldStyle, GUILayout.Height(27))) {
|
if (GUILayout.Button(string.Format(Translations.Timeline.LabelSuggestionsFormat, currentState.suggestionCount.ToString()), HotReloadWindowStyles.ClickableLabelBoldStyle, GUILayout.Height(27))) {
|
||||||
HotReloadPrefs.RunTabEventsSuggestionsFoldout = !HotReloadPrefs.RunTabEventsSuggestionsFoldout;
|
HotReloadPrefs.RunTabEventsSuggestionsFoldout = !HotReloadPrefs.RunTabEventsSuggestionsFoldout;
|
||||||
}
|
}
|
||||||
if (HotReloadPrefs.RunTabEventsSuggestionsFoldout) {
|
if (HotReloadPrefs.RunTabEventsSuggestionsFoldout) {
|
||||||
@@ -521,7 +522,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
using (new EditorGUILayout.VerticalScope()) {
|
using (new EditorGUILayout.VerticalScope()) {
|
||||||
HotReloadPrefs.RunTabEventsTimelineFoldout = EditorGUILayout.Foldout(HotReloadPrefs.RunTabEventsTimelineFoldout, "", true, HotReloadWindowStyles.CustomFoldoutStyle);
|
HotReloadPrefs.RunTabEventsTimelineFoldout = EditorGUILayout.Foldout(HotReloadPrefs.RunTabEventsTimelineFoldout, "", true, HotReloadWindowStyles.CustomFoldoutStyle);
|
||||||
GUILayout.Space(-23);
|
GUILayout.Space(-23);
|
||||||
if (GUILayout.Button("Timeline", HotReloadWindowStyles.ClickableLabelBoldStyle, timelineButtonOptions)) {
|
if (GUILayout.Button(Translations.Timeline.LabelTimeline, HotReloadWindowStyles.ClickableLabelBoldStyle, timelineButtonOptions)) {
|
||||||
HotReloadPrefs.RunTabEventsTimelineFoldout = !HotReloadPrefs.RunTabEventsTimelineFoldout;
|
HotReloadPrefs.RunTabEventsTimelineFoldout = !HotReloadPrefs.RunTabEventsTimelineFoldout;
|
||||||
}
|
}
|
||||||
if (HotReloadPrefs.RunTabEventsTimelineFoldout) {
|
if (HotReloadPrefs.RunTabEventsTimelineFoldout) {
|
||||||
@@ -534,20 +535,20 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
GUILayout.Space(2f);
|
GUILayout.Space(2f);
|
||||||
string text;
|
string text;
|
||||||
if (currentState.redeemStage != RedeemStage.None) {
|
if (currentState.redeemStage != RedeemStage.None) {
|
||||||
text = "Complete registration before using Hot Reload";
|
text = Translations.Timeline.MessageCompleteRegistration;
|
||||||
} else if (!currentState.running) {
|
} else if (!currentState.running) {
|
||||||
text = "Use the Start button to activate Hot Reload";
|
text = Translations.Timeline.MessageUseStartButton;
|
||||||
} else if (enabledFilters.Count < 4 && HotReloadTimelineHelper.EventsTimeline.Count != 0) {
|
} else if (enabledFilters.Count < 4 && HotReloadTimelineHelper.EventsTimeline.Count != 0) {
|
||||||
text = "Enable filters to see events";
|
text = Translations.Timeline.MessageEnableFilters;
|
||||||
} else {
|
} else {
|
||||||
text = "Make code changes to see events";
|
text = Translations.Timeline.MessageMakeCodeChanges;
|
||||||
}
|
}
|
||||||
GUILayout.Label(text, HotReloadWindowStyles.EmptyListText);
|
GUILayout.Label(text, HotReloadWindowStyles.EmptyListText);
|
||||||
}
|
}
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
} else {
|
} else {
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
if (HotReloadTimelineHelper.EventsTimeline.Count > 0 && GUILayout.Button("Clear")) {
|
if (HotReloadTimelineHelper.EventsTimeline.Count > 0 && GUILayout.Button(Translations.Common.ButtonClear)) {
|
||||||
HotReloadTimelineHelper.ClearEntries();
|
HotReloadTimelineHelper.ClearEntries();
|
||||||
if (HotReloadWindow.Current) {
|
if (HotReloadWindow.Current) {
|
||||||
HotReloadWindow.Current.Repaint();
|
HotReloadWindow.Current.Repaint();
|
||||||
@@ -573,23 +574,27 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
EditorGUILayout.LabelField($"Hot Reload Limited", HotReloadWindowStyles.H3CenteredTitleStyle);
|
EditorGUILayout.LabelField(Translations.License.TitleHotReloadLimited, HotReloadWindowStyles.H3CenteredTitleStyle);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
if (loginStatus.consumptionsUnavailableReason == ConsumptionsUnavailableReason.NetworkUnreachable) {
|
if (loginStatus.consumptionsUnavailableReason == ConsumptionsUnavailableReason.NetworkUnreachable) {
|
||||||
EditorGUILayout.HelpBox("Something went wrong. Please check your internet connection.", MessageType.Warning);
|
EditorGUILayout.HelpBox(Translations.Errors.ErrorNetworkIssue, MessageType.Warning);
|
||||||
} else if (loginStatus.consumptionsUnavailableReason == ConsumptionsUnavailableReason.UnrecoverableError) {
|
} else if (loginStatus.consumptionsUnavailableReason == ConsumptionsUnavailableReason.UnrecoverableError) {
|
||||||
EditorGUILayout.HelpBox("Something went wrong. Please contact support if the issue persists.", MessageType.Error);
|
EditorGUILayout.HelpBox(Translations.Errors.ErrorContactSupport, MessageType.Error);
|
||||||
} else if (loginStatus.freeSessionFinished) {
|
} else if (loginStatus.freeSessionFinished) {
|
||||||
var now = DateTime.UtcNow;
|
var now = DateTime.UtcNow;
|
||||||
var sessionRefreshesAt = (now.AddDays(1).Date - now).Add(TimeSpan.FromMinutes(5));
|
var sessionRefreshesAt = (now.AddDays(1).Date - now).Add(TimeSpan.FromMinutes(5));
|
||||||
var sessionRefreshString = $"Next Session: {(sessionRefreshesAt.Hours > 0 ? $"{sessionRefreshesAt.Hours}h " : "")}{sessionRefreshesAt.Minutes}min";
|
var sessionRefreshString = sessionRefreshesAt.Hours > 0 ?
|
||||||
|
string.Format(Translations.Miscellaneous.DailySessionNextSessionHours, sessionRefreshesAt.Hours, sessionRefreshesAt.Minutes) :
|
||||||
|
string.Format(Translations.Miscellaneous.DailySessionNextSessionMinutes, sessionRefreshesAt.Minutes);
|
||||||
HotReloadGUIHelper.HelpBox(sessionRefreshString, MessageType.Warning, fontSize: 11);
|
HotReloadGUIHelper.HelpBox(sessionRefreshString, MessageType.Warning, fontSize: 11);
|
||||||
} else if (loginStatus.freeSessionRunning && loginStatus.freeSessionEndTime != null) {
|
} else if (loginStatus.freeSessionRunning && loginStatus.freeSessionEndTime != null) {
|
||||||
var sessionEndsAt = loginStatus.freeSessionEndTime.Value - DateTime.Now;
|
var sessionEndsAt = loginStatus.freeSessionEndTime.Value - DateTime.Now;
|
||||||
var sessionString = $"Daily Session: {(sessionEndsAt.Hours > 0 ? $"{sessionEndsAt.Hours}h " : "")}{sessionEndsAt.Minutes}min Left";
|
var sessionString = sessionEndsAt.Hours > 0 ?
|
||||||
|
string.Format(Translations.Miscellaneous.DailySessionTimeHoursLeft, sessionEndsAt.Hours, sessionEndsAt.Minutes) :
|
||||||
|
string.Format(Translations.Miscellaneous.DailySessionTimeMinutesLeft, sessionEndsAt.Minutes);
|
||||||
HotReloadGUIHelper.HelpBox(sessionString, MessageType.Info, fontSize: 11);
|
HotReloadGUIHelper.HelpBox(sessionString, MessageType.Info, fontSize: 11);
|
||||||
} else if (loginStatus.freeSessionEndTime == null) {
|
} else if (loginStatus.freeSessionEndTime == null) {
|
||||||
HotReloadGUIHelper.HelpBox("Daily Session: Make code changes to start", MessageType.Info, fontSize: 11);
|
HotReloadGUIHelper.HelpBox(Translations.Miscellaneous.DailySessionStart, MessageType.Info, fontSize: 11);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -645,7 +650,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void RenderRecompileButton() {
|
private void RenderRecompileButton() {
|
||||||
string recompileText = HotReloadWindowStyles.windowScreenWidth > Constants.RecompileButtonTextHideWidth ? " Recompile" : "";
|
string recompileText = HotReloadWindowStyles.windowScreenWidth > Constants.RecompileButtonTextHideWidth ? Translations.UI.RecompileButtonLabel : "";
|
||||||
var recompileButton = new GUIContent(recompileText, GUIHelper.GetInvertibleIcon(InvertibleIcon.Recompile));
|
var recompileButton = new GUIContent(recompileText, GUIHelper.GetInvertibleIcon(InvertibleIcon.Recompile));
|
||||||
if (!GUILayout.Button(recompileButton, HotReloadWindowStyles.RecompileButton)) {
|
if (!GUILayout.Button(recompileButton, HotReloadWindowStyles.RecompileButton)) {
|
||||||
return;
|
return;
|
||||||
@@ -656,15 +661,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
public static void RecompileWithChecks() {
|
public static void RecompileWithChecks() {
|
||||||
var firstDialoguePass = HotReloadPrefs.RecompileDialogueShown
|
var firstDialoguePass = HotReloadPrefs.RecompileDialogueShown
|
||||||
|| EditorUtility.DisplayDialog(
|
|| EditorUtility.DisplayDialog(
|
||||||
title: "Hot Reload auto-applies changes",
|
title: Translations.Dialogs.DialogTitleRecompile,
|
||||||
message: "Using the Recompile button is only necessary when Hot Reload fails to apply your changes. \n\nDo you wish to proceed?",
|
message: Translations.Dialogs.DialogMessageRecompile,
|
||||||
ok: "Recompile",
|
ok: Translations.Common.ButtonRecompile.Trim(),
|
||||||
cancel: "Not now");
|
cancel: Translations.Common.ButtonNotNow);
|
||||||
HotReloadPrefs.RecompileDialogueShown = true;
|
HotReloadPrefs.RecompileDialogueShown = true;
|
||||||
if (!firstDialoguePass) {
|
if (!firstDialoguePass) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!ConfirmExitPlaymode("Using the Recompile button will stop Play Mode.\n\nDo you wish to proceed?")) {
|
if (!ConfirmExitPlaymode(Translations.Dialogs.DialogMessageStopPlayMode)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Recompile();
|
Recompile();
|
||||||
@@ -681,10 +686,10 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
public static bool ConfirmExitPlaymode(string message) {
|
public static bool ConfirmExitPlaymode(string message) {
|
||||||
return !Application.isPlaying
|
return !Application.isPlaying
|
||||||
|| EditorUtility.DisplayDialog(
|
|| EditorUtility.DisplayDialog(
|
||||||
title: "Stop Play Mode and Recompile?",
|
title: Translations.Dialogs.DialogTitleStopPlayMode,
|
||||||
message: message,
|
message: message,
|
||||||
ok: "Stop and Recompile",
|
ok: Translations.Common.ButtonStopAndRecompile,
|
||||||
cancel: "Cancel");
|
cancel: Translations.Common.ButtonCancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool recompiling;
|
public static bool recompiling;
|
||||||
@@ -708,7 +713,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!currentState.running && (currentState.startupProgress?.Item1 ?? 0) == 0) {
|
if (!currentState.running && (currentState.startupProgress?.Item1 ?? 0) == 0) {
|
||||||
string startText = HotReloadWindowStyles.windowScreenWidth > Constants.StartButtonTextHideWidth ? " Start" : "";
|
string startText = HotReloadWindowStyles.windowScreenWidth > Constants.StartButtonTextHideWidth ? Translations.UI.StartButtonLabel : "";
|
||||||
if (GUILayout.Button(new GUIContent(startText, GUIHelper.GetInvertibleIcon(InvertibleIcon.Start)), HotReloadWindowStyles.StartButton)) {
|
if (GUILayout.Button(new GUIContent(startText, GUIHelper.GetInvertibleIcon(InvertibleIcon.Start)), HotReloadWindowStyles.StartButton)) {
|
||||||
EditorCodePatcher.DownloadAndRun().Forget();
|
EditorCodePatcher.DownloadAndRun().Forget();
|
||||||
}
|
}
|
||||||
@@ -716,7 +721,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (HotReloadWindowStyles.windowScreenWidth > 150) {
|
if (HotReloadWindowStyles.windowScreenWidth > 150) {
|
||||||
RenderRecompileButton();
|
RenderRecompileButton();
|
||||||
}
|
}
|
||||||
string stopText = HotReloadWindowStyles.windowScreenWidth > Constants.StartButtonTextHideWidth ? " Stop" : "";
|
string stopText = HotReloadWindowStyles.windowScreenWidth > Constants.StartButtonTextHideWidth ? Translations.UI.StopButtonLabel : "";
|
||||||
if (GUILayout.Button(new GUIContent(stopText, GUIHelper.GetInvertibleIcon(InvertibleIcon.Stop)), HotReloadWindowStyles.StopButton)) {
|
if (GUILayout.Button(new GUIContent(stopText, GUIHelper.GetInvertibleIcon(InvertibleIcon.Stop)), HotReloadWindowStyles.StopButton)) {
|
||||||
if (!EditorCodePatcher.StoppedServerRecently()) {
|
if (!EditorCodePatcher.StoppedServerRecently()) {
|
||||||
EditorCodePatcher.StopCodePatcher().Forget();
|
EditorCodePatcher.StopCodePatcher().Forget();
|
||||||
@@ -818,15 +823,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
messageType = !loginStatus.freeSessionFinished ? MessageType.Warning : MessageType.Error;
|
messageType = !loginStatus.freeSessionFinished ? MessageType.Warning : MessageType.Error;
|
||||||
message = GetMessageFromError(currentState, loginStatus.lastLicenseError);
|
message = GetMessageFromError(currentState, loginStatus.lastLicenseError);
|
||||||
} else if (loginStatus.isTrial && !PackageConst.IsAssetStoreBuild) {
|
} else if (loginStatus.isTrial && !PackageConst.IsAssetStoreBuild) {
|
||||||
message = $"Using Trial license, valid until {loginStatus.licenseExpiresAt.ToShortDateString()}";
|
message = string.Format(Translations.UI.TrialLicenseMessage, loginStatus.licenseExpiresAt.ToShortDateString());
|
||||||
messageType = MessageType.Info;
|
messageType = MessageType.Info;
|
||||||
} else if (loginStatus.isIndieLicense) {
|
} else if (loginStatus.isIndieLicense) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
message = " Indie license active";
|
message = Translations.UI.IndieLicenseMessage;
|
||||||
messageType = MessageType.Info;
|
messageType = MessageType.Info;
|
||||||
customGUI = () => {
|
customGUI = () => {
|
||||||
if (loginStatus.licenseExpiresAt.Date != DateTime.MaxValue.Date) {
|
if (loginStatus.licenseExpiresAt.Date != DateTime.MaxValue.Date) {
|
||||||
EditorGUILayout.LabelField($"License will renew on {loginStatus.licenseExpiresAt.ToShortDateString()}.");
|
EditorGUILayout.LabelField(string.Format(Translations.UI.LicenseRenewalMessage, loginStatus.licenseExpiresAt.ToShortDateString()));
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
}
|
}
|
||||||
using (new GUILayout.HorizontalScope()) {
|
using (new GUILayout.HorizontalScope()) {
|
||||||
@@ -842,7 +847,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
} else if (loginStatus.isBusinessLicense) {
|
} else if (loginStatus.isBusinessLicense) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
message = " Business license active";
|
message = Translations.UI.BusinessLicenseMessage;
|
||||||
messageType = MessageType.Info;
|
messageType = MessageType.Info;
|
||||||
if (businessLicenseContent == null) {
|
if (businessLicenseContent == null) {
|
||||||
businessLicenseContent = new GUIContent(message, EditorGUIUtility.FindTexture("TestPassed"));
|
businessLicenseContent = new GUIContent(message, EditorGUIUtility.FindTexture("TestPassed"));
|
||||||
@@ -870,7 +875,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
style.fixedHeight = GUILayoutUtility.GetLastRect().height;
|
style.fixedHeight = GUILayoutUtility.GetLastRect().height;
|
||||||
}
|
}
|
||||||
if (allowHide) {
|
if (allowHide) {
|
||||||
if (GUILayout.Button("Hide", style)) {
|
if (GUILayout.Button(Translations.Common.ButtonHide, style)) {
|
||||||
HotReloadPrefs.ErrorHidden = true;
|
HotReloadPrefs.ErrorHidden = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -886,71 +891,58 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const string assetStoreProInfo = "Unity Pro/Enterprise users from company with your number of employees require a Business license. Please upgrade your license on our website.";
|
|
||||||
internal static void RenderBusinessLicenseInfo(GUIStyle style) {
|
internal static void RenderBusinessLicenseInfo(GUIStyle style) {
|
||||||
GUILayout.Space(8);
|
GUILayout.Space(8);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
EditorGUILayout.HelpBox(assetStoreProInfo, MessageType.Info);
|
EditorGUILayout.HelpBox(Translations.License.LicenseErrorAssetStorePro, MessageType.Info);
|
||||||
if (Event.current.type == EventType.Repaint) {
|
if (Event.current.type == EventType.Repaint) {
|
||||||
style.fixedHeight = GUILayoutUtility.GetLastRect().height;
|
style.fixedHeight = GUILayoutUtility.GetLastRect().height;
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Upgrade", style)) {
|
if (GUILayout.Button(Translations.Common.ButtonUpgrade, style)) {
|
||||||
Application.OpenURL(Constants.ProductPurchaseBusinessURL);
|
Application.OpenURL(Constants.ProductPurchaseBusinessURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void RenderIndieLicenseInfo(GUIStyle style) {
|
internal static void RenderIndieLicenseInfo(GUIStyle style) {
|
||||||
string message;
|
|
||||||
if (EditorCodePatcher.licenseType == UnityLicenseType.UnityPersonalPlus) {
|
|
||||||
message = "Unity Plus users require an Indie license. Please upgrade your license on our website.";
|
|
||||||
} else if (EditorCodePatcher.licenseType == UnityLicenseType.UnityPro) {
|
|
||||||
message = "Unity Pro/Enterprise users from company with your number of employees require an Indie license. Please upgrade your license on our website.";
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
GUILayout.Space(8);
|
GUILayout.Space(8);
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
EditorGUILayout.HelpBox(message, MessageType.Info);
|
EditorGUILayout.HelpBox(Translations.License.LicenseErrorUnityPlusIndie, MessageType.Info);
|
||||||
if (Event.current.type == EventType.Repaint) {
|
if (Event.current.type == EventType.Repaint) {
|
||||||
style.fixedHeight = GUILayoutUtility.GetLastRect().height;
|
style.fixedHeight = GUILayoutUtility.GetLastRect().height;
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Upgrade", style)) {
|
if (GUILayout.Button(Translations.Common.ButtonUpgrade, style)) {
|
||||||
Application.OpenURL(Constants.ProductPurchaseURL);
|
Application.OpenURL(Constants.ProductPurchaseURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const string GetLicense = "Get License";
|
|
||||||
const string ContactSupport = "Contact Support";
|
|
||||||
const string UpgradeLicense = "Upgrade License";
|
|
||||||
const string ManageLicense = "Manage License";
|
|
||||||
internal static Dictionary<string, LicenseErrorData> _licenseErrorData;
|
internal static Dictionary<string, LicenseErrorData> _licenseErrorData;
|
||||||
internal static Dictionary<string, LicenseErrorData> LicenseErrorData => _licenseErrorData ?? (_licenseErrorData = new Dictionary<string, LicenseErrorData> {
|
internal static Dictionary<string, LicenseErrorData> LicenseErrorData => _licenseErrorData ?? (_licenseErrorData = new Dictionary<string, LicenseErrorData> {
|
||||||
{ "DeviceNotLicensedException", new LicenseErrorData(description: "Another device is using your license. Please reach out to customer support for assistance.", showSupportButton: true, supportButtonText: ContactSupport) },
|
{ "DeviceNotLicensedException", new LicenseErrorData(description: Translations.License.LicenseErrorDeviceInUse, showSupportButton: true, supportButtonText: Translations.License.LicenseButtonContactSupport) },
|
||||||
{ "DeviceBlacklistedException", new LicenseErrorData(description: "You device has been blacklisted.") },
|
{ "DeviceBlacklistedException", new LicenseErrorData(description: Translations.License.LicenseErrorDeviceBlacklisted) },
|
||||||
{ "DateHeaderInvalidException", new LicenseErrorData(description: $"Your license is not working because your computer's clock is incorrect. Please set the clock to the correct time to restore your license.") },
|
{ "DateHeaderInvalidException", new LicenseErrorData(description: Translations.License.LicenseErrorIncorrectClock) },
|
||||||
{ "DateTimeCheatingException", new LicenseErrorData(description: $"Your license is not working because your computer's clock is incorrect. Please set the clock to the correct time to restore your license.") },
|
{ "DateTimeCheatingException", new LicenseErrorData(description: Translations.License.LicenseErrorIncorrectClock) },
|
||||||
{ "LicenseActivationException", new LicenseErrorData(description: "An error has occured while activating your license. Please contact customer support for assistance.", showSupportButton: true, supportButtonText: ContactSupport) },
|
{ "LicenseActivationException", new LicenseErrorData(description: Translations.License.LicenseErrorActivation, showSupportButton: true, supportButtonText: Translations.License.LicenseButtonContactSupport) },
|
||||||
{ "LicenseDeletedException", new LicenseErrorData(description: $"Your license has been deleted. Please contact customer support for assistance.", showBuyButton: true, buyButtonText: GetLicense, showSupportButton: true, supportButtonText: ContactSupport) },
|
{ "LicenseDeletedException", new LicenseErrorData(description: Translations.License.LicenseErrorDeleted, showBuyButton: true, buyButtonText: Translations.License.LicenseButtonGetLicense, showSupportButton: true, supportButtonText: Translations.License.LicenseButtonContactSupport) },
|
||||||
{ "LicenseDisabledException", new LicenseErrorData(description: $"Your license has been disabled. Please contact customer support for assistance.", showBuyButton: true, buyButtonText: GetLicense, showSupportButton: true, supportButtonText: ContactSupport) },
|
{ "LicenseDisabledException", new LicenseErrorData(description: Translations.License.LicenseErrorDisabled, showBuyButton: true, buyButtonText: Translations.License.LicenseButtonGetLicense, showSupportButton: true, supportButtonText: Translations.License.LicenseButtonContactSupport) },
|
||||||
{ "LicenseExpiredException", new LicenseErrorData(description: $"Your license has expired. Please renew your license subscription using the 'Upgrade License' button below and login with your email/password to activate your license.", showBuyButton: true, buyButtonText: UpgradeLicense, showManageLicenseButton: true, manageLicenseButtonText: ManageLicense) },
|
{ "LicenseExpiredException", new LicenseErrorData(description: Translations.License.LicenseErrorExpired, showBuyButton: true, buyButtonText: Translations.License.LicenseButtonUpgradeLicense, showManageLicenseButton: true, manageLicenseButtonText: Translations.License.LicenseButtonManageLicense) },
|
||||||
{ "LicenseInactiveException", new LicenseErrorData(description: $"Your license is currenty inactive. Please login with your email/password to activate your license.") },
|
{ "LicenseInactiveException", new LicenseErrorData(description: Translations.License.LicenseErrorInactive) },
|
||||||
{ "LocalLicenseException", new LicenseErrorData(description: $"Your license file was damaged or corrupted. Please login with your email/password to refresh your license file.") },
|
{ "LocalLicenseException", new LicenseErrorData(description: Translations.License.LicenseErrorCorrupted) },
|
||||||
// Note: obsolete
|
// Note: obsolete
|
||||||
{ "MissingParametersException", new LicenseErrorData(description: "An account already exists for this device. Please login with your existing email/password.", showBuyButton: true, buyButtonText: GetLicense) },
|
{ "MissingParametersException", new LicenseErrorData(description: "An account already exists for this device. Please login with your existing email/password.", showBuyButton: true, buyButtonText: Translations.License.LicenseButtonGetLicense) },
|
||||||
{ "NetworkException", new LicenseErrorData(description: "There is an issue connecting to our servers. Please check your internet connection or contact customer support if the issue persists.", showSupportButton: true, supportButtonText: ContactSupport) },
|
{ "NetworkException", new LicenseErrorData(description: Translations.License.LicenseErrorNetwork, showSupportButton: true, supportButtonText: Translations.License.LicenseButtonContactSupport) },
|
||||||
{ "TrialLicenseExpiredException", new LicenseErrorData(description: $"Your trial has expired. Activate a license with unlimited usage or continue using the Free version. View available plans on our website.", showBuyButton: true, buyButtonText: UpgradeLicense) },
|
{ "TrialLicenseExpiredException", new LicenseErrorData(description: Translations.License.LicenseErrorTrialExpired, showBuyButton: true, buyButtonText: Translations.License.LicenseButtonUpgradeLicense) },
|
||||||
{ "InvalidCredentialException", new LicenseErrorData(description: "Incorrect email/password. You can find your initial password in the sign-up email.") },
|
{ "InvalidCredentialException", new LicenseErrorData(description: Translations.License.LicenseErrorInvalidCredentials) },
|
||||||
// Note: activating free trial with email is not supported anymore. This error shouldn't happen which is why we should rather user the fallback
|
// Note: activating free trial with email is not supported anymore. This error shouldn't happen which is why we should rather user the fallback
|
||||||
// { "LicenseNotFoundException", new LicenseErrorData(description: "The account you're trying to access doesn't seem to exist yet. Please enter your email address to create a new account and receive a trial license.", showLoginButton: true, loginButtonText: CreateAccount) },
|
// { "LicenseNotFoundException", new LicenseErrorData(description: "The account you're trying to access doesn't seem to exist yet. Please enter your email address to create a new account and receive a trial license.", showLoginButton: true, loginButtonText: CreateAccount) },
|
||||||
{ "LicenseIncompatibleException", new LicenseErrorData(description: "Please upgrade your license to continue using hotreload with Unity Pro.", showManageLicenseButton: true, manageLicenseButtonText: ManageLicense) },
|
{ "LicenseIncompatibleException", new LicenseErrorData(description: Translations.License.LicenseErrorIncompatible, showManageLicenseButton: true, manageLicenseButtonText: Translations.License.LicenseButtonManageLicense) },
|
||||||
});
|
});
|
||||||
internal static LicenseErrorData defaultLicenseErrorData = new LicenseErrorData(description: "We apologize, an error happened while verifying your license. Please reach out to customer support for assistance.", showSupportButton: true, supportButtonText: ContactSupport);
|
internal static LicenseErrorData defaultLicenseErrorData = new LicenseErrorData(description: Translations.License.LicenseErrorDefault, showSupportButton: true, supportButtonText: Translations.License.LicenseButtonContactSupport);
|
||||||
|
|
||||||
internal static string GetMessageFromError(HotReloadRunTabState currentState, string error) {
|
internal static string GetMessageFromError(HotReloadRunTabState currentState, string error) {
|
||||||
if (PackageConst.IsAssetStoreBuild && error == "TrialLicenseExpiredException") {
|
if (PackageConst.IsAssetStoreBuild && error == "TrialLicenseExpiredException") {
|
||||||
return assetStoreProInfo;
|
return Translations.License.LicenseErrorAssetStorePro;
|
||||||
}
|
}
|
||||||
return GetLicenseErrorDataOrDefault(currentState, error).description;
|
return GetLicenseErrorDataOrDefault(currentState, error).description;
|
||||||
}
|
}
|
||||||
@@ -960,7 +952,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
return default(LicenseErrorData);
|
return default(LicenseErrorData);
|
||||||
}
|
}
|
||||||
if (currentState.loginStatus == null || string.IsNullOrEmpty(error) && (!currentState.loginStatus.isLicensed || currentState.loginStatus.isTrial)) {
|
if (currentState.loginStatus == null || string.IsNullOrEmpty(error) && (!currentState.loginStatus.isLicensed || currentState.loginStatus.isTrial)) {
|
||||||
return new LicenseErrorData(null, showBuyButton: true, buyButtonText: GetLicense);
|
return new LicenseErrorData(null, showBuyButton: true, buyButtonText: Translations.License.LicenseButtonGetLicense);
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(error)) {
|
if (string.IsNullOrEmpty(error)) {
|
||||||
return default(LicenseErrorData);
|
return default(LicenseErrorData);
|
||||||
@@ -1001,7 +993,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal static void RenderLicenseInfo(HotReloadRunTabState currentState, LoginStatusResponse loginStatus, bool verbose = false, bool allowHide = true, string overrideActionButton = null, bool showConsumptions = false) {
|
internal static void RenderLicenseInfo(HotReloadRunTabState currentState, LoginStatusResponse loginStatus, bool verbose = false, bool allowHide = true, string overrideActionButton = null, bool showConsumptions = false) {
|
||||||
HotReloadPrefs.ShowLogin = EditorGUILayout.Foldout(HotReloadPrefs.ShowLogin, "Hot Reload License", true, HotReloadWindowStyles.FoldoutStyle);
|
HotReloadPrefs.ShowLogin = EditorGUILayout.Foldout(HotReloadPrefs.ShowLogin, Translations.License.TitleHotReloadLicense, true, HotReloadWindowStyles.FoldoutStyle);
|
||||||
if (HotReloadPrefs.ShowLogin) {
|
if (HotReloadPrefs.ShowLogin) {
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
if ((loginStatus?.isLicensed != true && showConsumptions) && !(loginStatus == null || loginStatus.isFree)) {
|
if ((loginStatus?.isLicensed != true && showConsumptions) && !(loginStatus == null || loginStatus.isFree)) {
|
||||||
@@ -1017,22 +1009,22 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal void RenderPromoCodes() {
|
internal void RenderPromoCodes() {
|
||||||
HotReloadPrefs.ShowPromoCodes = EditorGUILayout.Foldout(HotReloadPrefs.ShowPromoCodes, "Promo Codes", true, HotReloadWindowStyles.FoldoutStyle);
|
HotReloadPrefs.ShowPromoCodes = EditorGUILayout.Foldout(HotReloadPrefs.ShowPromoCodes, Translations.License.PromoCodesTitle, true, HotReloadWindowStyles.FoldoutStyle);
|
||||||
if (!HotReloadPrefs.ShowPromoCodes) {
|
if (!HotReloadPrefs.ShowPromoCodes) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (promoCodeActivatedThisSession) {
|
if (promoCodeActivatedThisSession) {
|
||||||
EditorGUILayout.HelpBox($"Your promo code has been successfully activated. Free trial has been extended by 3 months.", MessageType.Info);
|
EditorGUILayout.HelpBox(Translations.License.MessagePromoCodeActivated, MessageType.Info);
|
||||||
} else {
|
} else {
|
||||||
if (promoCodeError != null && promoCodeErrorType != MessageType.None) {
|
if (promoCodeError != null && promoCodeErrorType != MessageType.None) {
|
||||||
EditorGUILayout.HelpBox(promoCodeError, promoCodeErrorType);
|
EditorGUILayout.HelpBox(promoCodeError, promoCodeErrorType);
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField("Promo code");
|
EditorGUILayout.LabelField(Translations.Common.LabelPromoCode);
|
||||||
_pendingPromoCode = EditorGUILayout.TextField(_pendingPromoCode);
|
_pendingPromoCode = EditorGUILayout.TextField(_pendingPromoCode);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
using (new EditorGUI.DisabledScope(_requestingActivatePromoCode)) {
|
using (new EditorGUI.DisabledScope(_requestingActivatePromoCode)) {
|
||||||
if (GUILayout.Button("Activate promo code", HotReloadRunTab.bigButtonHeight)) {
|
if (GUILayout.Button(Translations.Common.ButtonActivatePromoCode, HotReloadRunTab.bigButtonHeight)) {
|
||||||
RequestActivatePromoCode().Forget();
|
RequestActivatePromoCode().Forget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1083,7 +1075,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string ToPrettyErrorMessage(PromoCodeErrorType errorType) {
|
string ToPrettyErrorMessage(PromoCodeErrorType errorType) {
|
||||||
var defaultMsg = "We apologize, an error happened while activating your promo code. Please reach out to customer support for assistance.";
|
var defaultMsg = Translations.Errors.ErrorPromoCodeActivation;
|
||||||
switch (errorType) {
|
switch (errorType) {
|
||||||
case PromoCodeErrorType.MISSING_INPUT:
|
case PromoCodeErrorType.MISSING_INPUT:
|
||||||
case PromoCodeErrorType.INVALID_HTTP_METHOD:
|
case PromoCodeErrorType.INVALID_HTTP_METHOD:
|
||||||
@@ -1094,12 +1086,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
case PromoCodeErrorType.UPDATING_LICENSE_FAILED:
|
case PromoCodeErrorType.UPDATING_LICENSE_FAILED:
|
||||||
case PromoCodeErrorType.LICENSE_NOT_TRIAL:
|
case PromoCodeErrorType.LICENSE_NOT_TRIAL:
|
||||||
return defaultMsg;
|
return defaultMsg;
|
||||||
case PromoCodeErrorType.PROMO_CODE_NOT_FOUND: return "Your promo code is invalid. Please ensure that you have entered the correct promo code.";
|
case PromoCodeErrorType.PROMO_CODE_NOT_FOUND: return Translations.Errors.ErrorPromoCodeInvalid;
|
||||||
case PromoCodeErrorType.PROMO_CODE_CLAIMED: return "Your promo code has already been used.";
|
case PromoCodeErrorType.PROMO_CODE_CLAIMED: return Translations.Errors.ErrorPromoCodeUsed;
|
||||||
case PromoCodeErrorType.PROMO_CODE_EXPIRED: return "Your promo code has expired.";
|
case PromoCodeErrorType.PROMO_CODE_EXPIRED: return Translations.Errors.ErrorPromoCodeExpired;
|
||||||
case PromoCodeErrorType.LICENSE_ALREADY_EXTENDED: return "Your license has already been activated with a promo code. Only one promo code activation per license is allowed.";
|
case PromoCodeErrorType.LICENSE_ALREADY_EXTENDED: return Translations.Errors.ErrorLicenseExtended;
|
||||||
case PromoCodeErrorType.CONDITIONAL_CHECK_FAILED: return "We encountered an error while activating your promo code. Please try again. If the issue persists, please contact our customer support team for assistance.";
|
case PromoCodeErrorType.CONDITIONAL_CHECK_FAILED: return Translations.Errors.ErrorPromoCodeActivation;
|
||||||
case PromoCodeErrorType.NONE: return "There is an issue connecting to our servers. Please check your internet connection or contact customer support if the issue persists.";
|
case PromoCodeErrorType.NONE: return Translations.Errors.ErrorPromoCodeNetwork;
|
||||||
default: return defaultMsg;
|
default: return defaultMsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1129,12 +1121,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal static void RenderLicenseInnerPanel(HotReloadRunTabState currentState, string overrideActionButton = null, bool renderLogout = true) {
|
internal static void RenderLicenseInnerPanel(HotReloadRunTabState currentState, string overrideActionButton = null, bool renderLogout = true) {
|
||||||
EditorGUILayout.LabelField("Email");
|
EditorGUILayout.LabelField(Translations.Common.LabelEmail);
|
||||||
GUI.SetNextControlName("email");
|
GUI.SetNextControlName("email");
|
||||||
_pendingEmail = EditorGUILayout.TextField(string.IsNullOrEmpty(_pendingEmail) ? HotReloadPrefs.LicenseEmail : _pendingEmail);
|
_pendingEmail = EditorGUILayout.TextField(string.IsNullOrEmpty(_pendingEmail) ? HotReloadPrefs.LicenseEmail : _pendingEmail);
|
||||||
_pendingEmail = _pendingEmail.Trim();
|
_pendingEmail = _pendingEmail.Trim();
|
||||||
|
|
||||||
EditorGUILayout.LabelField("Password");
|
EditorGUILayout.LabelField(Translations.Common.LabelPassword);
|
||||||
GUI.SetNextControlName("password");
|
GUI.SetNextControlName("password");
|
||||||
_pendingPassword = EditorGUILayout.PasswordField(string.IsNullOrEmpty(_pendingPassword) ? HotReloadPrefs.LicensePassword : _pendingPassword);
|
_pendingPassword = EditorGUILayout.PasswordField(string.IsNullOrEmpty(_pendingPassword) ? HotReloadPrefs.LicensePassword : _pendingPassword);
|
||||||
|
|
||||||
@@ -1144,7 +1136,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
using(new EditorGUI.DisabledScope(currentState.requestingLoginInfo)) {
|
using(new EditorGUI.DisabledScope(currentState.requestingLoginInfo)) {
|
||||||
var btnLabel = overrideActionButton;
|
var btnLabel = overrideActionButton;
|
||||||
if (String.IsNullOrEmpty(overrideActionButton)) {
|
if (String.IsNullOrEmpty(overrideActionButton)) {
|
||||||
btnLabel = "Login";
|
btnLabel = Translations.Common.ButtonLogin;
|
||||||
}
|
}
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
var focusedControl = GUI.GetNameOfFocusedControl();
|
var focusedControl = GUI.GetNameOfFocusedControl();
|
||||||
@@ -1159,7 +1151,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (!string.IsNullOrEmpty(error)) {
|
if (!string.IsNullOrEmpty(error)) {
|
||||||
_activateInfoMessage = new Tuple<string, MessageType>(error, MessageType.Warning);
|
_activateInfoMessage = new Tuple<string, MessageType>(error, MessageType.Warning);
|
||||||
} else if (string.IsNullOrEmpty(_pendingPassword)) {
|
} else if (string.IsNullOrEmpty(_pendingPassword)) {
|
||||||
_activateInfoMessage = new Tuple<string, MessageType>("Please enter your password.", MessageType.Warning);
|
_activateInfoMessage = new Tuple<string, MessageType>(Translations.Errors.ErrorEnterPassword, MessageType.Warning);
|
||||||
} else {
|
} else {
|
||||||
HotReloadWindow.Current.SelectTab(typeof(HotReloadRunTab));
|
HotReloadWindow.Current.SelectTab(typeof(HotReloadRunTab));
|
||||||
|
|
||||||
@@ -1186,11 +1178,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
public static string ValidateEmail(string email) {
|
public static string ValidateEmail(string email) {
|
||||||
if (string.IsNullOrEmpty(email)) {
|
if (string.IsNullOrEmpty(email)) {
|
||||||
return "Please enter your email address.";
|
return Translations.Errors.ErrorEnterEmail;
|
||||||
} else if (!EditorWindowHelper.IsValidEmailAddress(email)) {
|
} else if (!EditorWindowHelper.IsValidEmailAddress(email)) {
|
||||||
return "Please enter a valid email address.";
|
return Translations.Errors.ErrorValidEmail;
|
||||||
} else if (email.Contains("+")) {
|
} else if (email.Contains("+")) {
|
||||||
return "Mail extensions (in a form of 'username+suffix@example.com') are not supported yet. Please provide your original email address (such as 'username@example.com' without '+suffix' part) as we're working on resolving this issue.";
|
return Translations.Errors.ErrorMailExtensions;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1199,7 +1191,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (currentState.loginStatus?.isLicensed != true) {
|
if (currentState.loginStatus?.isLicensed != true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Logout", bigButtonHeight)) {
|
if (GUILayout.Button(Translations.Common.ButtonLogout, bigButtonHeight)) {
|
||||||
HotReloadWindow.Current.SelectTab(typeof(HotReloadRunTab));
|
HotReloadWindow.Current.SelectTab(typeof(HotReloadRunTab));
|
||||||
if (!EditorCodePatcher.RequestingDownloadAndRun && !EditorCodePatcher.Running) {
|
if (!EditorCodePatcher.RequestingDownloadAndRun && !EditorCodePatcher.Running) {
|
||||||
LogoutOnDownloadAndRun().Forget();
|
LogoutOnDownloadAndRun().Forget();
|
||||||
@@ -1240,8 +1232,8 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
private static void RenderSwitchAuthMode() {
|
private static void RenderSwitchAuthMode() {
|
||||||
var color = EditorGUIUtility.isProSkin ? new Color32(0x3F, 0x9F, 0xFF, 0xFF) : new Color32(0x0F, 0x52, 0xD7, 0xFF);
|
var color = EditorGUIUtility.isProSkin ? new Color32(0x3F, 0x9F, 0xFF, 0xFF) : new Color32(0x0F, 0x52, 0xD7, 0xFF);
|
||||||
if (HotReloadGUIHelper.LinkLabel("Forgot password?", 12, FontStyle.Normal, TextAnchor.MiddleLeft, color)) {
|
if (HotReloadGUIHelper.LinkLabel(Translations.Miscellaneous.LinkForgotPassword, 12, FontStyle.Normal, TextAnchor.MiddleLeft, color)) {
|
||||||
if (EditorUtility.DisplayDialog("Recover password", "Use company code 'naughtycult' and the email you signed up with in order to recover your account.", "Open in browser", "Cancel")) {
|
if (EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleRecoverPassword, Translations.Dialogs.DialogMessageRecoverPassword, Translations.Common.ButtonOpenInBrowser, Translations.Common.ButtonCancel)) {
|
||||||
Application.OpenURL(Constants.ForgotPasswordURL);
|
Application.OpenURL(Constants.ForgotPasswordURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using SingularityGroup.HotReload.DTO;
|
using SingularityGroup.HotReload.DTO;
|
||||||
using SingularityGroup.HotReload.Editor.Cli;
|
using SingularityGroup.HotReload.Editor.Cli;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using EditorGUI = UnityEditor.EditorGUI;
|
using EditorGUI = UnityEditor.EditorGUI;
|
||||||
@@ -49,9 +50,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
[SuppressMessage("ReSharper", "Unity.UnknownResource")] // Rider doesn't check packages
|
[SuppressMessage("ReSharper", "Unity.UnknownResource")] // Rider doesn't check packages
|
||||||
public HotReloadSettingsTab(HotReloadWindow window) : base(window,
|
public HotReloadSettingsTab(HotReloadWindow window) : base(window,
|
||||||
"Settings",
|
Translations.Settings.SettingsTitle,
|
||||||
"_Popup",
|
"_Popup",
|
||||||
"Make changes to a build running on-device.") {
|
Translations.OnDevice.OnDeviceHeadline) {
|
||||||
optionsSection = new HotReloadOptionsSection();
|
optionsSection = new HotReloadOptionsSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +99,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionOuterBoxCompact)) {
|
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionOuterBoxCompact)) {
|
||||||
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionInnerBoxWide)) {
|
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionInnerBoxWide)) {
|
||||||
using (new EditorGUILayout.VerticalScope()) {
|
using (new EditorGUILayout.VerticalScope()) {
|
||||||
HotReloadPrefs.ShowConfiguration = EditorGUILayout.Foldout(HotReloadPrefs.ShowConfiguration, "Settings", true, HotReloadWindowStyles.FoldoutStyle);
|
HotReloadPrefs.ShowConfiguration = EditorGUILayout.Foldout(HotReloadPrefs.ShowConfiguration, Translations.Settings.SettingsConfiguration, true, HotReloadWindowStyles.FoldoutStyle);
|
||||||
if (HotReloadPrefs.ShowConfiguration) {
|
if (HotReloadPrefs.ShowConfiguration) {
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
@@ -111,8 +112,10 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
RenderAutoRecompileUnsupportedChangesImmediately();
|
RenderAutoRecompileUnsupportedChangesImmediately();
|
||||||
RenderAutoRecompileUnsupportedChangesOnExitPlayMode();
|
RenderAutoRecompileUnsupportedChangesOnExitPlayMode();
|
||||||
RenderAutoRecompileUnsupportedChangesInPlayMode();
|
RenderAutoRecompileUnsupportedChangesInPlayMode();
|
||||||
|
RenderAutoRecompileInspectorFieldEdits();
|
||||||
RenderAutoRecompilePartiallyUnsupportedChanges();
|
RenderAutoRecompilePartiallyUnsupportedChanges();
|
||||||
RenderDisplayNewMonobehaviourMethodsAsPartiallySupported();
|
RenderDisplayNewMonobehaviourMethodsAsPartiallySupported();
|
||||||
|
RenderAutoRecompileUnsupportedChangesInEditMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
@@ -186,12 +189,13 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionOuterBoxCompact)) {
|
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionOuterBoxCompact)) {
|
||||||
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionInnerBoxWide)) {
|
using (new EditorGUILayout.HorizontalScope(HotReloadWindowStyles.SectionInnerBoxWide)) {
|
||||||
using (new EditorGUILayout.VerticalScope()) {
|
using (new EditorGUILayout.VerticalScope()) {
|
||||||
HotReloadPrefs.ShowAdvanced = EditorGUILayout.Foldout(HotReloadPrefs.ShowAdvanced, "Advanced", true, HotReloadWindowStyles.FoldoutStyle);
|
HotReloadPrefs.ShowAdvanced = EditorGUILayout.Foldout(HotReloadPrefs.ShowAdvanced, Translations.Settings.SettingsAdvanced, true, HotReloadWindowStyles.FoldoutStyle);
|
||||||
if (HotReloadPrefs.ShowAdvanced) {
|
if (HotReloadPrefs.ShowAdvanced) {
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
DeactivateHotReload();
|
DeactivateHotReload();
|
||||||
DisableDetailedErrorReporting();
|
DisableDetailedErrorReporting();
|
||||||
|
PauseHotReloadInEditMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,15 +205,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderUnityAutoRefresh() {
|
void RenderUnityAutoRefresh() {
|
||||||
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent("Manage Unity auto-refresh (recommended)"), HotReloadPrefs.AllowDisableUnityAutoRefresh);
|
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleManageAutoRefresh), HotReloadPrefs.AllowDisableUnityAutoRefresh);
|
||||||
if (newSettings != HotReloadPrefs.AllowDisableUnityAutoRefresh) {
|
if (newSettings != HotReloadPrefs.AllowDisableUnityAutoRefresh) {
|
||||||
HotReloadPrefs.AllowDisableUnityAutoRefresh = newSettings;
|
HotReloadPrefs.AllowDisableUnityAutoRefresh = newSettings;
|
||||||
}
|
}
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.AllowDisableUnityAutoRefresh) {
|
if (HotReloadPrefs.AllowDisableUnityAutoRefresh) {
|
||||||
toggleDescription = "To avoid unnecessary recompiling, Hot Reload will automatically change Unity's Auto Refresh and Script Compilation settings. Previous settings will be restored when Hot Reload is stopped";
|
toggleDescription = Translations.Settings.SettingsManageAutoRefreshOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enabled this setting to auto-manage Unity's Auto Refresh and Script Compilation settings. This reduces unncessary recompiling";
|
toggleDescription = Translations.Settings.SettingsManageAutoRefreshOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -217,15 +221,14 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderAssetRefresh() {
|
void RenderAssetRefresh() {
|
||||||
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent("Asset refresh (recommended)"), HotReloadPrefs.AllAssetChanges);
|
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleAssetRefresh), HotReloadPrefs.AllAssetChanges);
|
||||||
if (newSettings != HotReloadPrefs.AllAssetChanges) {
|
if (newSettings != HotReloadPrefs.AllAssetChanges) {
|
||||||
HotReloadPrefs.AllAssetChanges = newSettings;
|
HotReloadPrefs.AllAssetChanges = newSettings;
|
||||||
// restart when setting changes
|
// restart when setting changes
|
||||||
if (ServerHealthCheck.I.IsServerHealthy) {
|
if (ServerHealthCheck.I.IsServerHealthy) {
|
||||||
var restartServer = EditorUtility.DisplayDialog("Hot Reload",
|
var restartServer = EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleRestartServer,
|
||||||
$"When changing 'Asset refresh', the Hot Reload server must be restarted for this to take effect." +
|
Translations.Dialogs.DialogMessageRestartAssetRefresh,
|
||||||
"\nDo you want to restart it now?",
|
Translations.Dialogs.DialogButtonRestartHotReload, Translations.Dialogs.DialogButtonDontRestart);
|
||||||
"Restart Hot Reload", "Don't restart");
|
|
||||||
if (restartServer) {
|
if (restartServer) {
|
||||||
EditorCodePatcher.RestartCodePatcher().Forget();
|
EditorCodePatcher.RestartCodePatcher().Forget();
|
||||||
}
|
}
|
||||||
@@ -233,9 +236,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.AllAssetChanges) {
|
if (HotReloadPrefs.AllAssetChanges) {
|
||||||
toggleDescription = "Hot Reload will refresh changed assets such as sprites, prefabs, etc";
|
toggleDescription = Translations.Settings.SettingsAssetRefreshOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to allow Hot Reload to refresh changed assets in the project. All asset types are supported including sprites, prefabs, shaders etc";
|
toggleDescription = Translations.Settings.SettingsAssetRefreshOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -243,16 +246,16 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderDebuggerCompatibility() {
|
void RenderDebuggerCompatibility() {
|
||||||
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent("Auto-disable Hot Reload while a debugger is attached (recommended)"), HotReloadPrefs.AutoDisableHotReloadWithDebugger);
|
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleDebuggerCompatibility), HotReloadPrefs.AutoDisableHotReloadWithDebugger);
|
||||||
if (newSettings != HotReloadPrefs.AutoDisableHotReloadWithDebugger) {
|
if (newSettings != HotReloadPrefs.AutoDisableHotReloadWithDebugger) {
|
||||||
HotReloadPrefs.AutoDisableHotReloadWithDebugger = newSettings;
|
HotReloadPrefs.AutoDisableHotReloadWithDebugger = newSettings;
|
||||||
CodePatcher.I.debuggerCompatibilityEnabled = !HotReloadPrefs.AutoDisableHotReloadWithDebugger;
|
CodePatcher.I.debuggerCompatibilityEnabled = !HotReloadPrefs.AutoDisableHotReloadWithDebugger;
|
||||||
}
|
}
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.AutoDisableHotReloadWithDebugger) {
|
if (HotReloadPrefs.AutoDisableHotReloadWithDebugger) {
|
||||||
toggleDescription = "Hot Reload automatically disables itself while a debugger is attached, as it can otherwise interfere with certain debugger features. Please read the documentation if you consider disabling this setting.";
|
toggleDescription = Translations.Settings.SettingsDebuggerCompatibilityOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "When a debugger is attached, Hot Reload will be active, but certain debugger features might not work as expected. Please read our documentation to learn about the limitations.";
|
toggleDescription = Translations.Settings.SettingsDebuggerCompatibilityOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -260,12 +263,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderIncludeShaderChanges() {
|
void RenderIncludeShaderChanges() {
|
||||||
HotReloadPrefs.IncludeShaderChanges = EditorGUILayout.BeginToggleGroup(new GUIContent("Refresh shaders"), HotReloadPrefs.IncludeShaderChanges);
|
HotReloadPrefs.IncludeShaderChanges = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleRefreshShaders), HotReloadPrefs.IncludeShaderChanges);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.IncludeShaderChanges) {
|
if (HotReloadPrefs.IncludeShaderChanges) {
|
||||||
toggleDescription = "Hot Reload will auto refresh shaders. Note that enabling this setting might impact performance.";
|
toggleDescription = Translations.Settings.SettingsRefreshShadersOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to auto-refresh shaders. Note that enabling this setting might impact performance";
|
toggleDescription = Translations.Settings.SettingsRefreshShadersOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -275,15 +278,14 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (!HotReloadCli.CanOpenInBackground) {
|
if (!HotReloadCli.CanOpenInBackground) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent("Hide console window on start"), HotReloadPrefs.DisableConsoleWindow);
|
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleHideConsole), HotReloadPrefs.DisableConsoleWindow);
|
||||||
if (newSettings != HotReloadPrefs.DisableConsoleWindow) {
|
if (newSettings != HotReloadPrefs.DisableConsoleWindow) {
|
||||||
HotReloadPrefs.DisableConsoleWindow = newSettings;
|
HotReloadPrefs.DisableConsoleWindow = newSettings;
|
||||||
// restart when setting changes
|
// restart when setting changes
|
||||||
if (ServerHealthCheck.I.IsServerHealthy) {
|
if (ServerHealthCheck.I.IsServerHealthy) {
|
||||||
var restartServer = EditorUtility.DisplayDialog("Hot Reload",
|
var restartServer = EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleRestartServer,
|
||||||
$"When changing 'Hide console window on start', the Hot Reload server must be restarted for this to take effect." +
|
Translations.Dialogs.DialogMessageRestartConsoleWindow,
|
||||||
"\nDo you want to restart it now?",
|
Translations.Dialogs.DialogButtonRestartServer, Translations.Dialogs.DialogButtonDontRestart);
|
||||||
"Restart server", "Don't restart");
|
|
||||||
if (restartServer) {
|
if (restartServer) {
|
||||||
EditorCodePatcher.RestartCodePatcher().Forget();
|
EditorCodePatcher.RestartCodePatcher().Forget();
|
||||||
}
|
}
|
||||||
@@ -291,9 +293,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.DisableConsoleWindow) {
|
if (HotReloadPrefs.DisableConsoleWindow) {
|
||||||
toggleDescription = "Hot Reload will start without creating a console window. Logs can be accessed through \"Help\" tab.";
|
toggleDescription = Translations.Settings.SettingsHideConsoleOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to start Hot Reload without creating a console window.";
|
toggleDescription = Translations.Settings.SettingsHideConsoleOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -301,15 +303,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DeactivateHotReload() {
|
void DeactivateHotReload() {
|
||||||
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent("Deactivate Hot Reload"), HotReloadPrefs.DeactivateHotReload);
|
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleDeactivate), HotReloadPrefs.DeactivateHotReload);
|
||||||
if (newSettings != HotReloadPrefs.DeactivateHotReload) {
|
if (newSettings != HotReloadPrefs.DeactivateHotReload) {
|
||||||
DeactivateHotReloadInner(newSettings);
|
DeactivateHotReloadInner(newSettings);
|
||||||
}
|
}
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.DeactivateHotReload) {
|
if (HotReloadPrefs.DeactivateHotReload) {
|
||||||
toggleDescription = "Hot Reload is deactivated.";
|
toggleDescription = Translations.Settings.SettingsDeactivatedOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to deactivate Hot Reload.";
|
toggleDescription = Translations.Settings.SettingsDeactivatedOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -317,13 +319,26 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DisableDetailedErrorReporting() {
|
void DisableDetailedErrorReporting() {
|
||||||
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent("Disable Detailed Error Reporting"), HotReloadPrefs.DisableDetailedErrorReporting);
|
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleDisableErrorReporting), HotReloadPrefs.DisableDetailedErrorReporting);
|
||||||
DisableDetailedErrorReportingInner(newSettings);
|
DisableDetailedErrorReportingInner(newSettings);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.DisableDetailedErrorReporting) {
|
if (HotReloadPrefs.DisableDetailedErrorReporting) {
|
||||||
toggleDescription = "Detailed error reporting is disabled.";
|
toggleDescription = Translations.Settings.SettingsDisableErrorReportingOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Toggle on to disable detailed error reporting.";
|
toggleDescription = Translations.Settings.SettingsDisableErrorReportingOff;
|
||||||
|
}
|
||||||
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
|
EditorGUILayout.EndToggleGroup();
|
||||||
|
EditorGUILayout.Space(6f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PauseHotReloadInEditMode() {
|
||||||
|
HotReloadPrefs.PauseHotReloadInEditMode = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.TogglePauseEditMode), HotReloadPrefs.PauseHotReloadInEditMode);
|
||||||
|
string toggleDescription;
|
||||||
|
if (HotReloadPrefs.PauseHotReloadInEditMode) {
|
||||||
|
toggleDescription = Translations.Settings.SettingsPauseEditModeOn;
|
||||||
|
} else {
|
||||||
|
toggleDescription = Translations.Settings.SettingsPauseEditModeOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -337,10 +352,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
HotReloadPrefs.DisableDetailedErrorReporting = newSetting;
|
HotReloadPrefs.DisableDetailedErrorReporting = newSetting;
|
||||||
// restart when setting changes
|
// restart when setting changes
|
||||||
if (ServerHealthCheck.I.IsServerHealthy) {
|
if (ServerHealthCheck.I.IsServerHealthy) {
|
||||||
var restartServer = EditorUtility.DisplayDialog("Hot Reload",
|
var restartServer = EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleRestartServer,
|
||||||
$"When changing 'Disable Detailed Error Reporting', the Hot Reload server must be restarted for this to take effect." +
|
Translations.Dialogs.DialogMessageRestartErrorReporting,
|
||||||
"\nDo you want to restart it now?",
|
Translations.Dialogs.DialogButtonRestartServer, Translations.Dialogs.DialogButtonDontRestart);
|
||||||
"Restart server", "Don't restart");
|
|
||||||
if (restartServer) {
|
if (restartServer) {
|
||||||
EditorCodePatcher.RestartCodePatcher().Forget();
|
EditorCodePatcher.RestartCodePatcher().Forget();
|
||||||
}
|
}
|
||||||
@@ -348,10 +362,9 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void DeactivateHotReloadInner(bool deactivate) {
|
static void DeactivateHotReloadInner(bool deactivate) {
|
||||||
var confirmed = !deactivate || EditorUtility.DisplayDialog("Hot Reload",
|
var confirmed = !deactivate || EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleDeactivate,
|
||||||
$"Hot Reload will be completely deactivated (unusable) until you activate it again." +
|
Translations.Dialogs.DialogMessageDeactivate,
|
||||||
"\n\nDo you want to proceed?",
|
Translations.Dialogs.DialogButtonDeactivate, Translations.Common.ButtonCancel);
|
||||||
"Deactivate", "Cancel");
|
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
HotReloadPrefs.DeactivateHotReload = deactivate;
|
HotReloadPrefs.DeactivateHotReload = deactivate;
|
||||||
if (deactivate) {
|
if (deactivate) {
|
||||||
@@ -363,15 +376,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderAutostart() {
|
void RenderAutostart() {
|
||||||
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent("Autostart on Unity open"), HotReloadPrefs.LaunchOnEditorStart);
|
var newSettings = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleAutostart), HotReloadPrefs.LaunchOnEditorStart);
|
||||||
if (newSettings != HotReloadPrefs.LaunchOnEditorStart) {
|
if (newSettings != HotReloadPrefs.LaunchOnEditorStart) {
|
||||||
HotReloadPrefs.LaunchOnEditorStart = newSettings;
|
HotReloadPrefs.LaunchOnEditorStart = newSettings;
|
||||||
}
|
}
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.LaunchOnEditorStart) {
|
if (HotReloadPrefs.LaunchOnEditorStart) {
|
||||||
toggleDescription = "Hot Reload will be launched when Unity project opens.";
|
toggleDescription = Translations.Settings.SettingsAutostartOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to launch Hot Reload when Unity project opens.";
|
toggleDescription = Translations.Settings.SettingsAutostartOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -380,11 +393,11 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
void RenderShowNotifications() {
|
void RenderShowNotifications() {
|
||||||
EditorGUILayout.Space(10f);
|
EditorGUILayout.Space(10f);
|
||||||
GUILayout.Label("Visual Feedback", HotReloadWindowStyles.NotificationsTitleStyle);
|
GUILayout.Label(Translations.Settings.SettingsVisualFeedback, HotReloadWindowStyles.NotificationsTitleStyle);
|
||||||
EditorGUILayout.Space(10f);
|
EditorGUILayout.Space(10f);
|
||||||
|
|
||||||
if (!EditorWindowHelper.supportsNotifications && !UnitySettingsHelper.I.playmodeTintSupported) {
|
if (!EditorWindowHelper.supportsNotifications && !UnitySettingsHelper.I.playmodeTintSupported) {
|
||||||
var toggleDescription = "Indications are not supported in the Unity version you use.";
|
var toggleDescription = Translations.Settings.SettingsIndicationsUnsupported;
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -396,19 +409,19 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
void RenderMiscHeader() {
|
void RenderMiscHeader() {
|
||||||
EditorGUILayout.Space(10f);
|
EditorGUILayout.Space(10f);
|
||||||
GUILayout.Label("Misc", HotReloadWindowStyles.NotificationsTitleStyle);
|
GUILayout.Label(Translations.Settings.SettingsMisc, HotReloadWindowStyles.NotificationsTitleStyle);
|
||||||
EditorGUILayout.Space(10f);
|
EditorGUILayout.Space(10f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderShowPatchingNotifications() {
|
void RenderShowPatchingNotifications() {
|
||||||
HotReloadPrefs.ShowPatchingNotifications = EditorGUILayout.BeginToggleGroup(new GUIContent("Patching Indication"), HotReloadPrefs.ShowPatchingNotifications);
|
HotReloadPrefs.ShowPatchingNotifications = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.TogglePatchingIndication), HotReloadPrefs.ShowPatchingNotifications);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (!EditorWindowHelper.supportsNotifications) {
|
if (!EditorWindowHelper.supportsNotifications) {
|
||||||
toggleDescription = "Patching Notification is not supported in the Unity version you use.";
|
toggleDescription = Translations.Settings.SettingsPatchingIndicationUnsupported;
|
||||||
} else if (!HotReloadPrefs.ShowPatchingNotifications) {
|
} else if (!HotReloadPrefs.ShowPatchingNotifications) {
|
||||||
toggleDescription = "Enable to show GameView and SceneView indications when Patching.";
|
toggleDescription = Translations.Settings.SettingsPatchingIndicationOff;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Indications will be shown in GameView and SceneView when Patching.";
|
toggleDescription = Translations.Settings.SettingsPatchingIndicationOn;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
@@ -427,16 +440,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
// EditorGUILayout.EndToggleGroup();
|
// EditorGUILayout.EndToggleGroup();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
[Obsolete("Not implemented")]
|
[Obsolete(Translations.MenuItems.NotImplementedObsolete)]
|
||||||
public static void ApplyApplyFieldInitializerEditsToExistingClassInstances(bool newSetting) {
|
public static void ApplyApplyFieldInitializerEditsToExistingClassInstances(bool newSetting) {
|
||||||
if (newSetting != HotReloadPrefs.ApplyFieldInitiailzerEditsToExistingClassInstances) {
|
if (newSetting != HotReloadPrefs.ApplyFieldInitiailzerEditsToExistingClassInstances) {
|
||||||
HotReloadPrefs.ApplyFieldInitiailzerEditsToExistingClassInstances = newSetting;
|
HotReloadPrefs.ApplyFieldInitiailzerEditsToExistingClassInstances = newSetting;
|
||||||
// restart when setting changes
|
// restart when setting changes
|
||||||
if (ServerHealthCheck.I.IsServerHealthy) {
|
if (ServerHealthCheck.I.IsServerHealthy) {
|
||||||
var restartServer = EditorUtility.DisplayDialog("Hot Reload",
|
var restartServer = EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleRestartServer,
|
||||||
$"When changing 'Apply field initializer edits to existing class instances' setting, the Hot Reload server must restart for it to take effect." +
|
Translations.Dialogs.DialogMessageRestartFieldInitializer,
|
||||||
"\nDo you want to restart it now?",
|
Translations.Dialogs.DialogButtonRestartServer, Translations.Dialogs.DialogButtonDontRestart);
|
||||||
"Restart server", "Don't restart");
|
|
||||||
if (restartServer) {
|
if (restartServer) {
|
||||||
EditorCodePatcher.RestartCodePatcher().Forget();
|
EditorCodePatcher.RestartCodePatcher().Forget();
|
||||||
}
|
}
|
||||||
@@ -445,95 +457,128 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderShowCompilingUnsupportedNotifications() {
|
void RenderShowCompilingUnsupportedNotifications() {
|
||||||
HotReloadPrefs.ShowCompilingUnsupportedNotifications = EditorGUILayout.BeginToggleGroup(new GUIContent("Compiling Unsupported Changes Indication"), HotReloadPrefs.ShowCompilingUnsupportedNotifications);
|
HotReloadPrefs.ShowCompilingUnsupportedNotifications = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleCompilingIndication), HotReloadPrefs.ShowCompilingUnsupportedNotifications);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (!EditorWindowHelper.supportsNotifications) {
|
if (!EditorWindowHelper.supportsNotifications) {
|
||||||
toggleDescription = "Compiling Unsupported Changes Notification is not supported in the Unity version you use.";
|
toggleDescription = Translations.Settings.SettingsCompilingIndicationUnsupported;
|
||||||
} else if (!HotReloadPrefs.ShowCompilingUnsupportedNotifications) {
|
} else if (!HotReloadPrefs.ShowCompilingUnsupportedNotifications) {
|
||||||
toggleDescription = "Enable to show GameView and SceneView indications when compiling unsupported changes.";
|
toggleDescription = Translations.Settings.SettingsCompilingIndicationOff;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Indications will be shown in GameView and SceneView when compiling unsupported changes.";
|
toggleDescription = Translations.Settings.SettingsCompilingIndicationOn;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderAutoRecompileUnsupportedChanges() {
|
void RenderAutoRecompileUnsupportedChanges() {
|
||||||
HotReloadPrefs.AutoRecompileUnsupportedChanges = EditorGUILayout.BeginToggleGroup(new GUIContent("Auto recompile unsupported changes (recommended)"), HotReloadPrefs.AutoRecompileUnsupportedChanges && EditorCodePatcher.autoRecompileUnsupportedChangesSupported);
|
HotReloadPrefs.AutoRecompileUnsupportedChanges = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleAutoRecompile), HotReloadPrefs.AutoRecompileUnsupportedChanges && EditorCodePatcher.autoRecompileUnsupportedChangesSupported);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (!EditorCodePatcher.autoRecompileUnsupportedChangesSupported) {
|
if (!EditorCodePatcher.autoRecompileUnsupportedChangesSupported) {
|
||||||
toggleDescription = "Auto recompiling unsupported changes is not supported in the Unity version you use.";
|
toggleDescription = Translations.Settings.SettingsAutoRecompileUnsupported;
|
||||||
} else if (HotReloadPrefs.AutoRecompileUnsupportedChanges) {
|
} else if (HotReloadPrefs.AutoRecompileUnsupportedChanges) {
|
||||||
toggleDescription = "Hot Reload will recompile automatically after code changes that Hot Reload doesn't support.";
|
toggleDescription = Translations.Settings.SettingsAutoRecompileOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "When enabled, recompile happens automatically after code changes that Hot Reload doesn't support.";
|
toggleDescription = Translations.Settings.SettingsAutoRecompileOff;
|
||||||
|
}
|
||||||
|
if (!HotReloadPrefs.AutoRecompileUnsupportedChangesInEditMode && !HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode) {
|
||||||
|
HotReloadPrefs.AutoRecompileUnsupportedChangesInEditMode = true;
|
||||||
|
}
|
||||||
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
|
EditorGUILayout.EndToggleGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAutoRecompileInspectorFieldEdits() {
|
||||||
|
HotReloadPrefs.AutoRecompileInspectorFieldsEdit = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleAutoRecompileInspector), HotReloadPrefs.AutoRecompileInspectorFieldsEdit);
|
||||||
|
string toggleDescription;
|
||||||
|
if (HotReloadPrefs.AutoRecompileInspectorFieldsEdit) {
|
||||||
|
toggleDescription = Translations.Settings.SettingsAutoRecompileInspectorOn;
|
||||||
|
} else {
|
||||||
|
toggleDescription = Translations.Settings.SettingsAutoRecompileInspectorOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderAutoRecompilePartiallyUnsupportedChanges() {
|
void RenderAutoRecompilePartiallyUnsupportedChanges() {
|
||||||
HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges = EditorGUILayout.BeginToggleGroup(new GUIContent("Include partially unsupported changes"), HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges);
|
HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleAutoRecompilePartial), HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges) {
|
if (HotReloadPrefs.AutoRecompilePartiallyUnsupportedChanges) {
|
||||||
toggleDescription = "Hot Reload will recompile partially unsupported changes.";
|
toggleDescription = Translations.Settings.SettingsAutoRecompilePartialOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to recompile partially unsupported changes.";
|
toggleDescription = Translations.Settings.SettingsAutoRecompilePartialOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderDisplayNewMonobehaviourMethodsAsPartiallySupported() {
|
void RenderDisplayNewMonobehaviourMethodsAsPartiallySupported() {
|
||||||
HotReloadPrefs.DisplayNewMonobehaviourMethodsAsPartiallySupported = EditorGUILayout.BeginToggleGroup(new GUIContent("Display new Monobehaviour methods as partially supported"), HotReloadPrefs.DisplayNewMonobehaviourMethodsAsPartiallySupported);
|
HotReloadPrefs.DisplayNewMonobehaviourMethodsAsPartiallySupported = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleDisplayMonobehaviour), HotReloadPrefs.DisplayNewMonobehaviourMethodsAsPartiallySupported);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.DisplayNewMonobehaviourMethodsAsPartiallySupported) {
|
if (HotReloadPrefs.DisplayNewMonobehaviourMethodsAsPartiallySupported) {
|
||||||
toggleDescription = "Hot Reload will display new monobehaviour methods as partially unsupported.";
|
toggleDescription = Translations.Settings.SettingsDisplayMonobehaviourOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to display new monobehaviour methods as partially unsupported.";
|
toggleDescription = Translations.Settings.SettingsDisplayMonobehaviourOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderAutoRecompileUnsupportedChangesImmediately() {
|
void RenderAutoRecompileUnsupportedChangesImmediately() {
|
||||||
HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately = EditorGUILayout.BeginToggleGroup(new GUIContent("Recompile immediately"), HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately);
|
HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleRecompileImmediately), HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately) {
|
if (HotReloadPrefs.AutoRecompileUnsupportedChangesImmediately) {
|
||||||
toggleDescription = "Unsupported changes will be recompiled immediately.";
|
toggleDescription = Translations.Settings.SettingsRecompileImmediatelyOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Unsupported changes will be recompiled when editor is focused. Enable to recompile immediately.";
|
toggleDescription = Translations.Settings.SettingsRecompileImmediatelyOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderAutoRecompileUnsupportedChangesInPlayMode() {
|
void RenderAutoRecompileUnsupportedChangesInPlayMode() {
|
||||||
HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode = EditorGUILayout.BeginToggleGroup(new GUIContent("Recompile in Play Mode"), HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode);
|
HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleRecompilePlayMode), HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode) {
|
if (HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode) {
|
||||||
toggleDescription = "Hot Reload will exit Play Mode to recompile unsupported changes.";
|
toggleDescription = Translations.Settings.SettingsRecompilePlayModeOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to auto exit Play Mode to recompile unsupported changes.";
|
toggleDescription = Translations.Settings.SettingsRecompilePlayModeOff;
|
||||||
|
}
|
||||||
|
if (!HotReloadPrefs.AutoRecompileUnsupportedChangesInEditMode && !HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode) {
|
||||||
|
HotReloadPrefs.AutoRecompileUnsupportedChanges = false;
|
||||||
|
}
|
||||||
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
|
EditorGUILayout.EndToggleGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderAutoRecompileUnsupportedChangesInEditMode() {
|
||||||
|
HotReloadPrefs.AutoRecompileUnsupportedChangesInEditMode = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleRecompileEditMode), HotReloadPrefs.AutoRecompileUnsupportedChangesInEditMode);
|
||||||
|
string toggleDescription;
|
||||||
|
if (HotReloadPrefs.AutoRecompileUnsupportedChangesInEditMode) {
|
||||||
|
toggleDescription = Translations.Settings.SettingsRecompileEditModeOn;
|
||||||
|
} else {
|
||||||
|
toggleDescription = Translations.Settings.SettingsRecompileEditModeOff;
|
||||||
|
}
|
||||||
|
if (!HotReloadPrefs.AutoRecompileUnsupportedChangesInEditMode && !HotReloadPrefs.AutoRecompileUnsupportedChangesInPlayMode) {
|
||||||
|
HotReloadPrefs.AutoRecompileUnsupportedChanges = false;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderAutoRecompileUnsupportedChangesOnExitPlayMode() {
|
void RenderAutoRecompileUnsupportedChangesOnExitPlayMode() {
|
||||||
HotReloadPrefs.AutoRecompileUnsupportedChangesOnExitPlayMode = EditorGUILayout.BeginToggleGroup(new GUIContent("Recompile on exit Play Mode"), HotReloadPrefs.AutoRecompileUnsupportedChangesOnExitPlayMode);
|
HotReloadPrefs.AutoRecompileUnsupportedChangesOnExitPlayMode = EditorGUILayout.BeginToggleGroup(new GUIContent(Translations.Settings.ToggleRecompileExitPlayMode), HotReloadPrefs.AutoRecompileUnsupportedChangesOnExitPlayMode);
|
||||||
string toggleDescription;
|
string toggleDescription;
|
||||||
if (HotReloadPrefs.AutoRecompileUnsupportedChangesOnExitPlayMode) {
|
if (HotReloadPrefs.AutoRecompileUnsupportedChangesOnExitPlayMode) {
|
||||||
toggleDescription = "Hot Reload will recompile unsupported changes when exiting Play Mode.";
|
toggleDescription = Translations.Settings.SettingsRecompileExitPlayModeOn;
|
||||||
} else {
|
} else {
|
||||||
toggleDescription = "Enable to recompile unsupported changes when exiting Play Mode.";
|
toggleDescription = Translations.Settings.SettingsRecompileExitPlayModeOff;
|
||||||
}
|
}
|
||||||
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
EditorGUILayout.LabelField(toggleDescription, HotReloadWindowStyles.WrapStyle);
|
||||||
EditorGUILayout.EndToggleGroup();
|
EditorGUILayout.EndToggleGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderOnDevice() {
|
void RenderOnDevice() {
|
||||||
HotReloadPrefs.ShowOnDevice = EditorGUILayout.Foldout(HotReloadPrefs.ShowOnDevice, "On-Device", true, HotReloadWindowStyles.FoldoutStyle);
|
HotReloadPrefs.ShowOnDevice = EditorGUILayout.Foldout(HotReloadPrefs.ShowOnDevice, Translations.Settings.SettingsOnDevice, true, HotReloadWindowStyles.FoldoutStyle);
|
||||||
if (!HotReloadPrefs.ShowOnDevice) {
|
if (!HotReloadPrefs.ShowOnDevice) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -559,7 +604,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
GUILayout.Space(9f); // space between logo and headline
|
GUILayout.Space(9f); // space between logo and headline
|
||||||
|
|
||||||
GUILayout.Label("Make changes to a build running on-device",
|
GUILayout.Label(Translations.OnDevice.OnDeviceHeadline,
|
||||||
headlineStyle, GUILayout.MinHeight(EditorGUIUtility.singleLineHeight * 1.4f));
|
headlineStyle, GUILayout.MinHeight(EditorGUIUtility.singleLineHeight * 1.4f));
|
||||||
// image showing how Hot Reload works with a phone
|
// image showing how Hot Reload works with a phone
|
||||||
// var bannerBox = GUILayoutUtility.GetRect(flowchart.width * 0.6f, flowchart.height * 0.6f);
|
// var bannerBox = GUILayoutUtility.GetRect(flowchart.width * 0.6f, flowchart.height * 0.6f);
|
||||||
@@ -571,7 +616,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
//ButtonToOpenBuildSettings();
|
//ButtonToOpenBuildSettings();
|
||||||
|
|
||||||
{
|
{
|
||||||
GUILayout.Label("Manual connect", HotReloadWindowStyles.H3TitleStyle);
|
GUILayout.Label(Translations.Settings.SettingsManualConnect, HotReloadWindowStyles.H3TitleStyle);
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
@@ -583,22 +628,21 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
string text;
|
string text;
|
||||||
var ip = IpHelper.GetIpAddressCached();
|
var ip = IpHelper.GetIpAddressCached();
|
||||||
if (string.IsNullOrEmpty(ip)) {
|
if (string.IsNullOrEmpty(ip)) {
|
||||||
text = $"If auto-pair fails, find your local IP in OS settings, and use this format to connect: '{{ip}}:{RequestHelper.port}'";
|
text = string.Format(Translations.OnDevice.OnDeviceManualConnectFormat, RequestHelper.port);
|
||||||
} else {
|
} else {
|
||||||
text = $"If auto-pair fails, use this IP and port to connect: {ip}:{RequestHelper.port}" +
|
text = string.Format(Translations.OnDevice.OnDeviceManualConnectWithIP, ip, RequestHelper.port);
|
||||||
"\nMake sure you are on the same LAN/WiFi network";
|
|
||||||
}
|
}
|
||||||
GUILayout.Label(text, HotReloadWindowStyles.H3TitleWrapStyle);
|
GUILayout.Label(text, HotReloadWindowStyles.H3TitleWrapStyle);
|
||||||
|
|
||||||
if (!currentState.isServerHealthy) {
|
if (!currentState.isServerHealthy) {
|
||||||
DrawHorizontalCheck(ServerHealthCheck.I.IsServerHealthy,
|
DrawHorizontalCheck(ServerHealthCheck.I.IsServerHealthy,
|
||||||
"Hot Reload is running",
|
Translations.OnDevice.OnDeviceCheckHotReloadRunning,
|
||||||
"Hot Reload is not running",
|
Translations.OnDevice.OnDeviceCheckHotReloadNotRunning,
|
||||||
hasFix: false);
|
hasFix: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HotReloadPrefs.ExposeServerToLocalNetwork) {
|
if (!HotReloadPrefs.ExposeServerToLocalNetwork) {
|
||||||
var summary = $"Enable '{new ExposeServerOption().ShortSummary}'";
|
var summary = string.Format(Translations.OnDevice.OnDeviceCheckEnableExposeServer, new ExposeServerOption().ShortSummary);
|
||||||
DrawHorizontalCheck(HotReloadPrefs.ExposeServerToLocalNetwork,
|
DrawHorizontalCheck(HotReloadPrefs.ExposeServerToLocalNetwork,
|
||||||
summary,
|
summary,
|
||||||
summary);
|
summary);
|
||||||
@@ -620,10 +664,10 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
{
|
{
|
||||||
|
|
||||||
EditorGUILayout.BeginHorizontal();
|
EditorGUILayout.BeginHorizontal();
|
||||||
GUILayout.Label("Build Settings Checklist", HotReloadWindowStyles.H3TitleStyle);
|
GUILayout.Label(Translations.Settings.SettingsBuildSettingsChecklist, HotReloadWindowStyles.H3TitleStyle);
|
||||||
EditorGUI.BeginDisabledGroup(isSupported);
|
EditorGUI.BeginDisabledGroup(isSupported);
|
||||||
// One-click to change each setting to the supported value
|
// One-click to change each setting to the supported value
|
||||||
if (GUILayout.Button("Fix All", GUILayout.MaxWidth(90f))) {
|
if (GUILayout.Button(Translations.Common.ButtonFixAll, GUILayout.MaxWidth(90f))) {
|
||||||
FixAllUnsupportedSettings(so);
|
FixAllUnsupportedSettings(so);
|
||||||
}
|
}
|
||||||
EditorGUI.EndDisabledGroup();
|
EditorGUI.EndDisabledGroup();
|
||||||
@@ -641,7 +685,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
// Settings checkboxes (Hot Reload options)
|
// Settings checkboxes (Hot Reload options)
|
||||||
{
|
{
|
||||||
GUILayout.Label("Options", HotReloadWindowStyles.H3TitleStyle);
|
GUILayout.Label(Translations.Settings.SettingsOptions, HotReloadWindowStyles.H3TitleStyle);
|
||||||
if (settingsObject) {
|
if (settingsObject) {
|
||||||
optionsSection.DrawGUI(so);
|
optionsSection.DrawGUI(so);
|
||||||
}
|
}
|
||||||
@@ -655,7 +699,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
currentState.loginStatus,
|
currentState.loginStatus,
|
||||||
verbose: true,
|
verbose: true,
|
||||||
allowHide: false,
|
allowHide: false,
|
||||||
overrideActionButton: "Activate License",
|
overrideActionButton:Translations.Common.ButtonActivateLicense,
|
||||||
showConsumptions: true
|
showConsumptions: true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -731,12 +775,12 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (current == buildTarget) {
|
if (current == buildTarget) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var confirmed = EditorUtility.DisplayDialog("Switch Build Target",
|
var confirmed = EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleSwitchBuildTarget,
|
||||||
"Switching the build target can take a while depending on project size.",
|
Translations.Dialogs.DialogMessageSwitchBuildTarget,
|
||||||
$"Switch to Standalone", "Cancel");
|
Translations.Dialogs.DialogButtonSwitchToStandalone, Translations.Common.ButtonCancel);
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
EditorUserBuildSettings.SwitchActiveBuildTargetAsync(BuildTargetGroup.Standalone, buildTarget);
|
EditorUserBuildSettings.SwitchActiveBuildTargetAsync(BuildTargetGroup.Standalone, buildTarget);
|
||||||
Log.Info($"Build target is switching to {buildTarget}.");
|
Log.Info(Translations.About.LogBuildTargetSwitching, buildTarget);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -755,28 +799,28 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
isSupported = true;
|
isSupported = true;
|
||||||
var selectedPlatform = currentBuildTarget.Value;
|
var selectedPlatform = currentBuildTarget.Value;
|
||||||
DrawHorizontalCheck(isCurrentBuildTargetSupported.Value,
|
DrawHorizontalCheck(isCurrentBuildTargetSupported.Value,
|
||||||
$"The {selectedPlatform.ToString()} platform is selected",
|
string.Format(Translations.OnDevice.OnDeviceCheckPlatformSelected, selectedPlatform.ToString()),
|
||||||
$"The current platform is {selectedPlatform.ToString()} which is not supported");
|
string.Format(Translations.OnDevice.OnDeviceCheckPlatformNotSupported, selectedPlatform.ToString()));
|
||||||
|
|
||||||
using (new EditorGUI.DisabledScope(!isCurrentBuildTargetSupported.Value)) {
|
using (new EditorGUI.DisabledScope(!isCurrentBuildTargetSupported.Value)) {
|
||||||
foreach (var option in allOptions) {
|
foreach (var option in allOptions) {
|
||||||
DrawHorizontalCheck(option.GetValue(so),
|
DrawHorizontalCheck(option.GetValue(so),
|
||||||
$"Enable \"{option.ShortSummary}\"",
|
string.Format(Translations.OnDevice.OnDeviceCheckEnableExposeServer, option.ShortSummary),
|
||||||
$"Enable \"{option.ShortSummary}\"");
|
string.Format(Translations.OnDevice.OnDeviceCheckEnableExposeServer, option.ShortSummary));
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawHorizontalCheck(EditorUserBuildSettings.development,
|
DrawHorizontalCheck(EditorUserBuildSettings.development,
|
||||||
"Development Build is enabled",
|
Translations.OnDevice.OnDeviceCheckDevelopmentEnabled,
|
||||||
"Enable \"Development Build\"");
|
Translations.OnDevice.OnDeviceCheckEnableDevelopment);
|
||||||
|
|
||||||
DrawHorizontalCheck(ScriptingBackend == ScriptingImplementation.Mono2x,
|
DrawHorizontalCheck(ScriptingBackend == ScriptingImplementation.Mono2x,
|
||||||
$"Scripting Backend is set to Mono",
|
Translations.OnDevice.OnDeviceCheckMonoBackend,
|
||||||
$"Set Scripting Backend to Mono");
|
Translations.OnDevice.OnDeviceCheckSetMonoBackend);
|
||||||
|
|
||||||
DrawHorizontalCheck(StrippingLevel == ManagedStrippingLevel.Disabled,
|
DrawHorizontalCheck(StrippingLevel == ManagedStrippingLevel.Disabled,
|
||||||
$"Stripping Level = {StrippingLevel}",
|
string.Format(Translations.OnDevice.OnDeviceCheckStrippingLevel, StrippingLevel),
|
||||||
$"Stripping Level = {StrippingLevel}",
|
string.Format(Translations.OnDevice.OnDeviceCheckStrippingLevel, StrippingLevel),
|
||||||
suggestedSolutionText: "Code stripping needs to be disabled to ensure that all methods are available for patching."
|
suggestedSolutionText: Translations.OnDevice.OnDeviceCheckStrippingSolution
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using SingularityGroup.HotReload.Editor.Cli;
|
|||||||
using SingularityGroup.HotReload.Editor.Semver;
|
using SingularityGroup.HotReload.Editor.Semver;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Compilation;
|
using UnityEditor.Compilation;
|
||||||
|
using SingularityGroup.HotReload.Editor.Localization;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("SingularityGroup.HotReload.EditorSamples")]
|
[assembly: InternalsVisibleTo("SingularityGroup.HotReload.EditorSamples")]
|
||||||
@@ -53,7 +54,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
|
|
||||||
static readonly PackageUpdateChecker packageUpdateChecker = new PackageUpdateChecker();
|
static readonly PackageUpdateChecker packageUpdateChecker = new PackageUpdateChecker();
|
||||||
|
|
||||||
[MenuItem("Window/Hot Reload/Open &#H")]
|
[MenuItem(Translations.MenuItems.OpenHotReload)]
|
||||||
internal static void Open() {
|
internal static void Open() {
|
||||||
// opening the window on CI systems was keeping Unity open indefinitely
|
// opening the window on CI systems was keeping Unity open indefinitely
|
||||||
if (EditorWindowHelper.IsHumanControllingUs()) {
|
if (EditorWindowHelper.IsHumanControllingUs()) {
|
||||||
@@ -66,7 +67,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[MenuItem("Window/Hot Reload/Recompile")]
|
[MenuItem(Translations.MenuItems.RecompileHotReload)]
|
||||||
internal static void Recompile() {
|
internal static void Recompile() {
|
||||||
HotReloadRunTab.Recompile();
|
HotReloadRunTab.Recompile();
|
||||||
}
|
}
|
||||||
@@ -262,15 +263,15 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
using (new EditorGUILayout.VerticalScope(renderAppBoxStyle)) {
|
using (new EditorGUILayout.VerticalScope(renderAppBoxStyle)) {
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
HotReloadGUIHelper.HelpBox("Are you enjoying using Hot Reload?", MessageType.Info, 11);
|
HotReloadGUIHelper.HelpBox(Translations.Miscellaneous.RateAppQuestion, MessageType.Info, 11);
|
||||||
if (GUILayout.Button("Hide", NonExpandableLayout)) {
|
if (GUILayout.Button(Translations.Common.ButtonHide, NonExpandableLayout)) {
|
||||||
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Debug, StatFeature.RateApp), new EditorExtraData { { "dismissed", true } }).Forget();
|
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Debug, StatFeature.RateApp), new EditorExtraData { { "dismissed", true } }).Forget();
|
||||||
HotReloadPrefs.RateAppShown = true;
|
HotReloadPrefs.RateAppShown = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
using (new EditorGUILayout.HorizontalScope()) {
|
using (new EditorGUILayout.HorizontalScope()) {
|
||||||
if (GUILayout.Button("Yes")) {
|
if (GUILayout.Button(Translations.Common.ButtonYes)) {
|
||||||
var openedUrl = PackageConst.IsAssetStoreBuild && EditorUtility.DisplayDialog("Rate Hot Reload", "Thank you for using Hot Reload!\n\nPlease consider leaving a review on the Asset Store to support us.", "Open in browser", "Cancel");
|
var openedUrl = PackageConst.IsAssetStoreBuild && EditorUtility.DisplayDialog(Translations.Dialogs.DialogTitleRateApp, Translations.Dialogs.DialogMessageRateApp, Translations.Common.ButtonOpenInBrowser, Translations.Common.ButtonCancel);
|
||||||
if (openedUrl) {
|
if (openedUrl) {
|
||||||
Application.OpenURL(Constants.UnityStoreRateAppURL);
|
Application.OpenURL(Constants.UnityStoreRateAppURL);
|
||||||
}
|
}
|
||||||
@@ -282,7 +283,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
data.Add("enjoy_app", true);
|
data.Add("enjoy_app", true);
|
||||||
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Debug, StatFeature.RateApp), data).Forget();
|
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Debug, StatFeature.RateApp), data).Forget();
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("No")) {
|
if (GUILayout.Button(Translations.Common.ButtonNo)) {
|
||||||
HotReloadPrefs.RateAppShown = true;
|
HotReloadPrefs.RateAppShown = true;
|
||||||
var data = new EditorExtraData();
|
var data = new EditorExtraData();
|
||||||
data.Add("enjoy_app", false);
|
data.Add("enjoy_app", false);
|
||||||
@@ -304,7 +305,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderUpdateButton(SemVersion newVersion) {
|
void RenderUpdateButton(SemVersion newVersion) {
|
||||||
if (GUILayout.Button($"Update To v{newVersion}", HotReloadWindowStyles.UpgradeButtonStyle)) {
|
if (GUILayout.Button(string.Format(Translations.Miscellaneous.ButtonUpdateToVersionFormat, newVersion), HotReloadWindowStyles.UpgradeButtonStyle)) {
|
||||||
packageUpdateChecker.UpdatePackageAsync(newVersion).Forget(CancellationToken.None);
|
packageUpdateChecker.UpdatePackageAsync(newVersion).Forget(CancellationToken.None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,7 +316,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
EditorGUIUtility.labelWidth = 105f;
|
EditorGUIUtility.labelWidth = 105f;
|
||||||
using (new GUILayout.VerticalScope()) {
|
using (new GUILayout.VerticalScope()) {
|
||||||
using (new GUILayout.HorizontalScope()) {
|
using (new GUILayout.HorizontalScope()) {
|
||||||
GUILayout.Label("Show On Startup");
|
GUILayout.Label(Translations.Common.LabelShowOnStartup);
|
||||||
Rect buttonRect = GUILayoutUtility.GetLastRect();
|
Rect buttonRect = GUILayoutUtility.GetLastRect();
|
||||||
if (EditorGUILayout.DropdownButton(new GUIContent(Regex.Replace(_showOnStartupOption.ToString(), "([a-z])([A-Z])", "$1 $2")), FocusType.Passive, GUILayout.Width(110f))) {
|
if (EditorGUILayout.DropdownButton(new GUIContent(Regex.Replace(_showOnStartupOption.ToString(), "([a-z])([A-Z])", "$1 $2")), FocusType.Passive, GUILayout.Width(110f))) {
|
||||||
GenericMenu menu = new GenericMenu();
|
GenericMenu menu = new GenericMenu();
|
||||||
@@ -336,7 +337,6 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static readonly OpenURLButton autoRefreshTroubleshootingBtn = new OpenURLButton("Troubleshooting", Constants.TroubleshootingURL);
|
|
||||||
void RenderBottomBarCore() {
|
void RenderBottomBarCore() {
|
||||||
bool troubleshootingShown = EditorCodePatcher.Started && HotReloadWindowStyles.windowScreenWidth >= 400;
|
bool troubleshootingShown = EditorCodePatcher.Started && HotReloadWindowStyles.windowScreenWidth >= 400;
|
||||||
bool alertsShown = EditorCodePatcher.Started && HotReloadWindowStyles.windowScreenWidth > Constants.EventFiltersShownHideWidth;
|
bool alertsShown = EditorCodePatcher.Started && HotReloadWindowStyles.windowScreenWidth > Constants.EventFiltersShownHideWidth;
|
||||||
@@ -376,7 +376,7 @@ namespace SingularityGroup.HotReload.Editor {
|
|||||||
if (troubleshootingShown) {
|
if (troubleshootingShown) {
|
||||||
using (new EditorGUILayout.VerticalScope()) {
|
using (new EditorGUILayout.VerticalScope()) {
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
autoRefreshTroubleshootingBtn.OnGUI();
|
OpenURLButton.Render(Translations.Miscellaneous.ButtonTroubleshooting, Constants.TroubleshootingURL);
|
||||||
GUILayout.FlexibleSpace();
|
GUILayout.FlexibleSpace();
|
||||||
}
|
}
|
||||||
GUILayout.Space(21);
|
GUILayout.Space(21);
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../../script"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c5fb35f04def51646a584aa23b72d056
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -52,4 +51,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -86,6 +85,11 @@ namespace SingularityGroup.HotReload {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string buildMachineRequestOrigin;
|
public string buildMachineRequestOrigin;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used to define which language the package is translated to
|
||||||
|
/// </summary>
|
||||||
|
public string locale;
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public HashSet<string> DefineSymbolsAsHashSet {
|
public HashSet<string> DefineSymbolsAsHashSet {
|
||||||
get {
|
get {
|
||||||
@@ -168,4 +172,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -38,4 +37,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -10,6 +8,7 @@ using System.Runtime.CompilerServices;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using SingularityGroup.HotReload.DTO;
|
using SingularityGroup.HotReload.DTO;
|
||||||
|
using SingularityGroup.HotReload.Localization;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using SingularityGroup.HotReload.Burst;
|
using SingularityGroup.HotReload.Burst;
|
||||||
using SingularityGroup.HotReload.HarmonyLib;
|
using SingularityGroup.HotReload.HarmonyLib;
|
||||||
@@ -33,16 +32,17 @@ namespace SingularityGroup.HotReload {
|
|||||||
public List<SField> addedFields = new List<SField>();
|
public List<SField> addedFields = new List<SField>();
|
||||||
public readonly List<SMethod> patchedSMethods = new List<SMethod>();
|
public readonly List<SMethod> patchedSMethods = new List<SMethod>();
|
||||||
public bool inspectorModified;
|
public bool inspectorModified;
|
||||||
|
public bool inspectorFieldAdded;
|
||||||
public readonly List<Tuple<SMethod, string>> patchFailures = new List<Tuple<SMethod, string>>();
|
public readonly List<Tuple<SMethod, string>> patchFailures = new List<Tuple<SMethod, string>>();
|
||||||
public readonly List<string> patchExceptions = new List<string>();
|
public readonly List<string> patchExceptions = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
class FieldHandler {
|
class FieldHandler {
|
||||||
public readonly Action<Type, FieldInfo> storeField;
|
public readonly Func<Type, FieldInfo, bool> storeField;
|
||||||
public readonly Action<Type, FieldInfo, FieldInfo> registerInspectorFieldAttributes;
|
public readonly Action<Type, FieldInfo, FieldInfo> registerInspectorFieldAttributes;
|
||||||
public readonly Func<Type, string, bool> hideField;
|
public readonly Func<Type, string, bool> hideField;
|
||||||
|
|
||||||
public FieldHandler(Action<Type, FieldInfo> storeField, Func<Type, string, bool> hideField, Action<Type, FieldInfo, FieldInfo> registerInspectorFieldAttributes) {
|
public FieldHandler(Func<Type, FieldInfo, bool> storeField, Func<Type, string, bool> hideField, Action<Type, FieldInfo, FieldInfo> registerInspectorFieldAttributes) {
|
||||||
this.storeField = storeField;
|
this.storeField = storeField;
|
||||||
this.hideField = hideField;
|
this.hideField = hideField;
|
||||||
this.registerInspectorFieldAttributes = registerInspectorFieldAttributes;
|
this.registerInspectorFieldAttributes = registerInspectorFieldAttributes;
|
||||||
@@ -79,7 +79,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
try {
|
try {
|
||||||
LoadPatches(PersistencePath);
|
LoadPatches(PersistencePath);
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
Log.Error("Encountered exception when loading patches from disk:\n{0}", ex);
|
Log.Error($"{Localization.Translations.Logging.LoadingPatchesFromDiskError}\n{ex}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,12 +91,12 @@ namespace SingularityGroup.HotReload {
|
|||||||
|
|
||||||
|
|
||||||
void LoadPatches(string filePath) {
|
void LoadPatches(string filePath) {
|
||||||
PlayerLog("Loading patches from file {0}", filePath);
|
PlayerLog(Localization.Translations.Logging.LoadingPatchesFromFile, filePath);
|
||||||
var file = new FileInfo(filePath);
|
var file = new FileInfo(filePath);
|
||||||
if(file.Exists) {
|
if(file.Exists) {
|
||||||
var bytes = File.ReadAllText(filePath);
|
var bytes = File.ReadAllText(filePath);
|
||||||
var patches = JsonConvert.DeserializeObject<List<MethodPatchResponse>>(bytes);
|
var patches = JsonConvert.DeserializeObject<List<MethodPatchResponse>>(bytes);
|
||||||
PlayerLog("Loaded {0} patches from disk", patches.Count.ToString());
|
PlayerLog(Localization.Translations.Logging.LoadedPatchesFromDisk, patches.Count.ToString());
|
||||||
foreach (var patch in patches) {
|
foreach (var patch in patches) {
|
||||||
RegisterPatches(patch, persist: false);
|
RegisterPatches(patch, persist: false);
|
||||||
}
|
}
|
||||||
@@ -114,13 +114,13 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal RegisterPatchesResult RegisterPatches(MethodPatchResponse patches, bool persist) {
|
internal RegisterPatchesResult RegisterPatches(MethodPatchResponse patches, bool persist) {
|
||||||
PlayerLog("Register patches.\nWarnings: {0} \nMethods:\n{1}", string.Join("\n", patches.failures), string.Join("\n", patches.patches.SelectMany(p => p.modifiedMethods).Select(m => m.displayName)));
|
PlayerLog(Localization.Translations.Logging.RegisterPatches, string.Join("\n", patches.failures), string.Join("\n", patches.patches.SelectMany(p => p.modifiedMethods).Select(m => m.displayName)));
|
||||||
pendingPatches.Add(patches);
|
pendingPatches.Add(patches);
|
||||||
return ApplyPatches(persist);
|
return ApplyPatches(persist);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterPatchesResult ApplyPatches(bool persist) {
|
RegisterPatchesResult ApplyPatches(bool persist) {
|
||||||
PlayerLog("ApplyPatches. {0} patches pending.", pendingPatches.Count);
|
PlayerLog(Localization.Translations.Logging.ApplyPatchesPending, pendingPatches.Count);
|
||||||
EnsureSymbolResolver();
|
EnsureSymbolResolver();
|
||||||
|
|
||||||
var result = new RegisterPatchesResult();
|
var result = new RegisterPatchesResult();
|
||||||
@@ -161,7 +161,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
Dispatch.OnHotReload(result.patchedMethods).Forget();
|
Dispatch.OnHotReload(result.patchedMethods).Forget();
|
||||||
}
|
}
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
Log.Warning("Exception occured when handling method patch. Exception:\n{0}", ex);
|
Log.Warning($"{Localization.Translations.Logging.ExceptionHandlingMethodPatch}\n{ex}");
|
||||||
} finally {
|
} finally {
|
||||||
pendingPatches.Clear();
|
pendingPatches.Clear();
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
if (didLog || !UnityEventHelper.UnityMethodsAdded()) {
|
if (didLog || !UnityEventHelper.UnityMethodsAdded()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log.Warning("A new Scene was loaded while new unity event methods were added at runtime. MonoBehaviours in the Scene will not trigger these new events.");
|
Log.Warning(Localization.Translations.Logging.SceneLoadedWithNewUnityEventMethods);
|
||||||
didLog = true;
|
didLog = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
try {
|
try {
|
||||||
UnityEventHelper.EnsureUnityEventMethod(newMethod);
|
UnityEventHelper.EnsureUnityEventMethod(newMethod);
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
Log.Warning("Encountered exception in EnsureUnityEventMethod: {0} {1}", ex.GetType().Name, ex.Message);
|
Log.Warning(Localization.Translations.Logging.ExceptionEnsureUnityEventMethod, ex.GetType().Name, ex.Message);
|
||||||
}
|
}
|
||||||
MethodUtils.DisableVisibilityChecks(newMethod);
|
MethodUtils.DisableVisibilityChecks(newMethod);
|
||||||
if (!patch.patchMethods.Any(m => m.metadataToken == sMethod.metadataToken)) {
|
if (!patch.patchMethods.Any(m => m.metadataToken == sMethod.metadataToken)) {
|
||||||
@@ -231,7 +231,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
{ StatKey.PatchId, patch.patchId },
|
{ StatKey.PatchId, patch.patchId },
|
||||||
{ StatKey.Detailed_Exception, ex.ToString() },
|
{ StatKey.Detailed_Exception, ex.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
result.patchExceptions.Add($"Edit requires full recompile to apply: Encountered exception when applying a patch.\nCommon causes: editing code that failed to patch previously, an unsupported change, or a real bug in Hot Reload.\nIf you think this is a bug, please report the issue on Discord and include a code-snippet before/after.\nException: {ex}");
|
result.patchExceptions.Add($"{Localization.Translations.Logging.ExceptionApplyingPatch}\nException: {ex}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,7 +247,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
} catch (SymbolResolvingFailedException) {
|
} catch (SymbolResolvingFailedException) {
|
||||||
// ignore, not a unity event method if can't resolve
|
// ignore, not a unity event method if can't resolve
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
Log.Warning("Encountered exception in RemoveUnityEventMethod: {0} {1}", ex.GetType().Name, ex.Message);
|
Log.Warning(Localization.Translations.Logging.ExceptionRemoveUnityEventMethod, ex.GetType().Name, ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
var declaringType = SymbolResolver.Resolve(sField.declaringType);
|
var declaringType = SymbolResolver.Resolve(sField.declaringType);
|
||||||
var method = SymbolResolver.Resolve(sMethod);
|
var method = SymbolResolver.Resolve(sMethod);
|
||||||
if (!(method is MethodInfo initializer)) {
|
if (!(method is MethodInfo initializer)) {
|
||||||
Log.Warning($"Failed registering initializer for field {sField.fieldName} in {sField.declaringType.typeName}. Field value might not be initialized correctly. Invalid method.");
|
Log.Warning(string.Format(Localization.Translations.Logging.FailedRegisteringInitializerInvalidMethod, sField.fieldName, sField.declaringType.typeName));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// We infer if the field is static by the number of parameters the method has
|
// We infer if the field is static by the number of parameters the method has
|
||||||
@@ -276,7 +276,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
{ StatKey.PatchId, resp.id },
|
{ StatKey.PatchId, resp.id },
|
||||||
{ StatKey.Detailed_Exception, e.ToString() },
|
{ StatKey.Detailed_Exception, e.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
Log.Warning($"Failed registering initializer for field {sField.fieldName} in {sField.declaringType.typeName}. Field value might not be initialized correctly. Exception: {e.Message}");
|
Log.Warning(string.Format(Localization.Translations.Logging.FailedRegisteringInitializerException, sField.fieldName, sField.declaringType.typeName, e.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -292,7 +292,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
{ StatKey.PatchId, resp.id },
|
{ StatKey.PatchId, resp.id },
|
||||||
{ StatKey.Detailed_Exception, e.ToString() },
|
{ StatKey.Detailed_Exception, e.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
Log.Warning($"Failed registering new field definitions for field {sField.fieldName} in {sField.declaringType.typeName}. Exception: {e.Message}");
|
Log.Warning(string.Format(Localization.Translations.Logging.FailedRegisteringNewFieldDefinitions, sField.fieldName, sField.declaringType.typeName, e.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -310,7 +310,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
{ StatKey.PatchId, resp.id },
|
{ StatKey.PatchId, resp.id },
|
||||||
{ StatKey.Detailed_Exception, e.ToString() },
|
{ StatKey.Detailed_Exception, e.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
Log.Warning($"Failed removing initializer for field {sField.fieldName} in {sField.declaringType.typeName}. Field value might not be initialized correctly. Exception: {e.Message}");
|
Log.Warning(string.Format(Localization.Translations.Logging.FailedRemovingInitializer, sField.fieldName, sField.declaringType.typeName, e.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -333,7 +333,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
{ StatKey.PatchId, resp.id },
|
{ StatKey.PatchId, resp.id },
|
||||||
{ StatKey.Detailed_Exception, e.ToString() },
|
{ StatKey.Detailed_Exception, e.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
Log.Warning($"Failed removing field value from {f.fieldName} in {f.declaringType.typeName}. Field value in code might not be up to date. Exception: {e.Message}");
|
Log.Warning(string.Format(Localization.Translations.Logging.FailedRemovingFieldValue, f.fieldName, f.declaringType.typeName, e.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (var i = 0; i < renamedReshapedFieldsFrom.Length; i++) {
|
for (var i = 0; i < renamedReshapedFieldsFrom.Length; i++) {
|
||||||
@@ -356,7 +356,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
{ StatKey.PatchId, resp.id },
|
{ StatKey.PatchId, resp.id },
|
||||||
{ StatKey.Detailed_Exception, e.ToString() },
|
{ StatKey.Detailed_Exception, e.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
Log.Warning($"Failed moving field value from {fromField} to {toField} in {toField.declaringType.typeName}. Field value in code might not be up to date. Exception: {e.Message}");
|
Log.Warning(Localization.Translations.Logging.FailedMovingFieldValue, fromField, toField, toField.declaringType.typeName, e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -400,7 +400,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
{ StatKey.PatchId, resp.id },
|
{ StatKey.PatchId, resp.id },
|
||||||
{ StatKey.Detailed_Exception, e.ToString() },
|
{ StatKey.Detailed_Exception, e.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
Log.Warning($"Failed updating field attributes of {original.fieldName} in {original.declaringType.typeName}. Updates might not reflect in the inspector. Exception: {e.Message}");
|
Log.Warning(string.Format(Localization.Translations.Logging.FailedUpdatingFieldAttributes, original.fieldName, original.declaringType.typeName, e.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -414,14 +414,14 @@ namespace SingularityGroup.HotReload {
|
|||||||
try {
|
try {
|
||||||
var declaringType = SymbolResolver.Resolve(sField.declaringType);
|
var declaringType = SymbolResolver.Resolve(sField.declaringType);
|
||||||
var field = SymbolResolver.Resolve(sField);
|
var field = SymbolResolver.Resolve(sField);
|
||||||
fieldHandler?.storeField?.Invoke(declaringType, field);
|
result.inspectorFieldAdded = fieldHandler?.storeField?.Invoke(declaringType, field) ?? false;
|
||||||
result.inspectorModified = true;
|
result.inspectorModified = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Error, StatFeature.Patching, StatEventType.AddInspectorField), new EditorExtraData {
|
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Error, StatFeature.Patching, StatEventType.AddInspectorField), new EditorExtraData {
|
||||||
{ StatKey.PatchId, patchId },
|
{ StatKey.PatchId, patchId },
|
||||||
{ StatKey.Detailed_Exception, e.ToString() },
|
{ StatKey.Detailed_Exception, e.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
Log.Warning($"Failed adding field {sField.fieldName}:{sField.declaringType.typeName} to the inspector. Field will not be displayed. Exception: {e.Message}");
|
Log.Warning(string.Format(Localization.Translations.Logging.FailedAddingFieldToInspector, sField.fieldName, sField.declaringType.typeName, e.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.addedFields.AddRange(sFields);
|
result.addedFields.AddRange(sFields);
|
||||||
@@ -444,7 +444,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
{ StatKey.PatchId, patchId },
|
{ StatKey.PatchId, patchId },
|
||||||
{ StatKey.Detailed_Exception, e.ToString() },
|
{ StatKey.Detailed_Exception, e.ToString() },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
Log.Warning($"Failed hiding field {sField.fieldName}:{sField.declaringType.typeName} from the inspector. Exception: {e.Message}");
|
Log.Warning(string.Format(Localization.Translations.Logging.FailedHidingFieldFromInspector, sField.fieldName, sField.declaringType.typeName, e.Message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (alteredFieldHidden) {
|
if (alteredFieldHidden) {
|
||||||
@@ -466,22 +466,21 @@ namespace SingularityGroup.HotReload {
|
|||||||
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Error, StatFeature.Patching, StatEventType.DebuggerAttached), new EditorExtraData {
|
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Error, StatFeature.Patching, StatEventType.DebuggerAttached), new EditorExtraData {
|
||||||
{ StatKey.PatchId, patchId },
|
{ StatKey.PatchId, patchId },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
return "Patching methods is not allowed while the Debugger is attached. You can change this behavior in settings if Hot Reload is compatible with the debugger you're running.";
|
return Localization.Translations.Logging.DebuggerAttachedNotAllowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DateTime.UtcNow - start > TimeSpan.FromMilliseconds(500)) {
|
if (DateTime.UtcNow - start > TimeSpan.FromMilliseconds(500)) {
|
||||||
Log.Info("Hot Reload apply took {0}", (DateTime.UtcNow - start).TotalMilliseconds);
|
Log.Info(Localization.Translations.Logging.HotReloadApplyTook, (DateTime.UtcNow - start).TotalMilliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state.match == null) {
|
if(state.match == null) {
|
||||||
var error = "Edit requires full recompile to apply: Method mismatch: {0}, patch: {1}. \nCommon causes: editing code that failed to patch previously, an unsupported change, or a real bug in Hot Reload.\nIf you think this is a bug, please report the issue on Discord and include a code-snippet before/after.";
|
|
||||||
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Error, StatFeature.Patching, StatEventType.MethodMismatch), new EditorExtraData {
|
RequestHelper.RequestEditorEventWithRetry(new Stat(StatSource.Client, StatLevel.Error, StatFeature.Patching, StatEventType.MethodMismatch), new EditorExtraData {
|
||||||
{ StatKey.PatchId, patchId },
|
{ StatKey.PatchId, patchId },
|
||||||
}).Forget();
|
}).Forget();
|
||||||
return string.Format(error, sOriginalMethod.simpleName, patchMethod.Name);
|
return string.Format(Localization.Translations.Logging.MethodMismatch, sOriginalMethod.simpleName, patchMethod.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerLog("Detour method {0:X8} {1}, offset: {2}", sOriginalMethod.metadataToken, patchMethod.Name, state.offset);
|
PlayerLog(Localization.Translations.Logging.DetourMethod, sOriginalMethod.metadataToken, patchMethod.Name, state.offset);
|
||||||
DetourResult result;
|
DetourResult result;
|
||||||
DetourApi.DetourMethod(state.match, patchMethod, out result);
|
DetourApi.DetourMethod(state.match, patchMethod, out result);
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
@@ -617,7 +616,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string HandleMethodPatchFailure(SMethod method, Exception exception) {
|
string HandleMethodPatchFailure(SMethod method, Exception exception) {
|
||||||
return $"Edit requires full recompile to apply: Failed to apply patch for method {method.displayName} in assembly {method.assemblyName}.\nCommon causes: editing code that failed to patch previously, an unsupported change, or a real bug in Hot Reload.\nIf you think this is a bug, please report the issue on Discord and include a code-snippet before/after.\nException: {exception}";
|
return string.Format(Localization.Translations.Logging.FailedToApplyPatchForMethod, method.displayName, method.assemblyName, exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnsureSymbolResolver() {
|
void EnsureSymbolResolver() {
|
||||||
@@ -664,12 +663,12 @@ namespace SingularityGroup.HotReload {
|
|||||||
filePath = Path.GetFullPath(filePath);
|
filePath = Path.GetFullPath(filePath);
|
||||||
var dir = Path.GetDirectoryName(filePath);
|
var dir = Path.GetDirectoryName(filePath);
|
||||||
if(string.IsNullOrEmpty(dir)) {
|
if(string.IsNullOrEmpty(dir)) {
|
||||||
throw new ArgumentException("Invalid path: " + filePath, nameof(filePath));
|
throw new ArgumentException(string.Format(Localization.Translations.Logging.InvalidPath, filePath), nameof(filePath));
|
||||||
}
|
}
|
||||||
Directory.CreateDirectory(dir);
|
Directory.CreateDirectory(dir);
|
||||||
var history = patchHistory.ToList();
|
var history = patchHistory.ToList();
|
||||||
|
|
||||||
PlayerLog("Saving {0} applied patches to {1}", history.Count, filePath);
|
PlayerLog(Localization.Translations.Logging.SavingAppliedPatches, history.Count, filePath);
|
||||||
|
|
||||||
await Task.Run(() => {
|
await Task.Run(() => {
|
||||||
using (FileStream fs = File.Create(filePath))
|
using (FileStream fs = File.Create(filePath))
|
||||||
@@ -717,4 +716,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ namespace SingularityGroup.HotReload.Demo {
|
|||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update() {
|
void Update() {
|
||||||
if (Demo.I.IsServerRunning()) {
|
if (Demo.I.IsServerRunning()) {
|
||||||
informationText.text = "Hot Reload is running";
|
informationText.text = Localization.Translations.Common.HotReloadIsRunning;
|
||||||
} else {
|
} else {
|
||||||
informationText.text = "Hot Reload is not running";
|
informationText.text = Localization.Translations.Common.HotReloadIsNotRunning;
|
||||||
}
|
}
|
||||||
|
|
||||||
// // 2. Editing functions in monobehaviours, normal classes or static classes
|
// // 2. Editing functions in monobehaviours, normal classes or static classes
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ namespace SingularityGroup.HotReload.Demo {
|
|||||||
handle.Complete();
|
handle.Complete();
|
||||||
|
|
||||||
if (Demo.I.IsServerRunning()) {
|
if (Demo.I.IsServerRunning()) {
|
||||||
informationText.text = "Hot Reload is running";
|
informationText.text = Localization.Translations.Common.HotReloadIsRunning;
|
||||||
} else {
|
} else {
|
||||||
informationText.text = "Hot Reload is not running";
|
informationText.text = Localization.Translations.Common.HotReloadIsNotRunning;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace SingularityGroup.HotReload {
|
||||||
|
|
||||||
|
internal static class HotReloadSettingsHelper {
|
||||||
|
public static UnityEngine.GameObject GetOrCreateSettingsPrefab(string prefabAssetPath) {
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
var prefab = AssetDatabase.LoadAssetAtPath<UnityEngine.GameObject>(prefabAssetPath);
|
||||||
|
if (prefab == null) {
|
||||||
|
// when you use HotReload as a unitypackage, prefab is somewhere inside your assets folder
|
||||||
|
var guids = AssetDatabase.FindAssets("HotReloadPrompts t:prefab", new string[]{"Assets"});
|
||||||
|
var paths = guids.Select(guid => AssetDatabase.GUIDToAssetPath(guid));
|
||||||
|
var promptsPrefabPath = paths.FirstOrDefault(assetpath => Path.GetFileName(assetpath) == "HotReloadPrompts.prefab");
|
||||||
|
if (promptsPrefabPath != null) {
|
||||||
|
prefab = AssetDatabase.LoadAssetAtPath<UnityEngine.GameObject>(promptsPrefabPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (prefab == null) {
|
||||||
|
throw new Exception(Localization.Translations.Errors.FailedPromptsPrefab);
|
||||||
|
}
|
||||||
|
return prefab;
|
||||||
|
#else
|
||||||
|
return null;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HotReloadSettingsObject GetSettingsObject(string editorAssetPath) {
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
return AssetDatabase.LoadAssetAtPath<HotReloadSettingsObject>(editorAssetPath);
|
||||||
|
#else
|
||||||
|
return null;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4bff36678f3d4a2bb24c477d28f96888
|
||||||
|
timeCreated: 1765129558
|
||||||
@@ -1,14 +1,8 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
using UnityEditor;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload {
|
namespace SingularityGroup.HotReload {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// HotReload runtime settings. These can be changed while the app is running.
|
/// HotReload runtime settings. These can be changed while the app is running.
|
||||||
@@ -62,11 +56,7 @@ namespace SingularityGroup.HotReload {
|
|||||||
private static HotReloadSettingsObject LoadSettings() {
|
private static HotReloadSettingsObject LoadSettings() {
|
||||||
HotReloadSettingsObject settings;
|
HotReloadSettingsObject settings;
|
||||||
if (Application.isEditor) {
|
if (Application.isEditor) {
|
||||||
#if UNITY_EDITOR
|
settings = HotReloadSettingsHelper.GetSettingsObject(editorAssetPath);
|
||||||
settings = AssetDatabase.LoadAssetAtPath<HotReloadSettingsObject>(editorAssetPath);
|
|
||||||
#else
|
|
||||||
settings = null;
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
// load from Resources (assumes that build includes the resource)
|
// load from Resources (assumes that build includes the resource)
|
||||||
settings = Resources.Load<HotReloadSettingsObject>(resourceName);
|
settings = Resources.Load<HotReloadSettingsObject>(resourceName);
|
||||||
@@ -93,38 +83,21 @@ namespace SingularityGroup.HotReload {
|
|||||||
|
|
||||||
// Call this during build, just to be sure the field is correct. (I had some issues with it while editing the prefab)
|
// Call this during build, just to be sure the field is correct. (I had some issues with it while editing the prefab)
|
||||||
public void EnsurePrefabSetCorrectly() {
|
public void EnsurePrefabSetCorrectly() {
|
||||||
#if UNITY_EDITOR
|
PromptsPrefab = HotReloadSettingsHelper.GetOrCreateSettingsPrefab(prefabAssetPath);
|
||||||
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(prefabAssetPath);
|
|
||||||
if (prefab == null) {
|
|
||||||
// when you use HotReload as a unitypackage, prefab is somewhere inside your assets folder
|
|
||||||
var guids = AssetDatabase.FindAssets("HotReloadPrompts t:prefab", new string[]{"Assets"});
|
|
||||||
var paths = guids.Select(guid => AssetDatabase.GUIDToAssetPath(guid));
|
|
||||||
var promptsPrefabPath = paths.FirstOrDefault(assetpath => Path.GetFileName(assetpath) == "HotReloadPrompts.prefab");
|
|
||||||
if (promptsPrefabPath != null) {
|
|
||||||
prefab = AssetDatabase.LoadAssetAtPath<GameObject>(promptsPrefabPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (prefab == null) {
|
|
||||||
throw new Exception("Failed to find PromptsPrefab (are you using Hot Reload as a package?");
|
|
||||||
}
|
|
||||||
PromptsPrefab = prefab;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EnsurePrefabNotInBuild() {
|
public void EnsurePrefabNotInBuild() {
|
||||||
#if UNITY_EDITOR
|
|
||||||
PromptsPrefab = null;
|
PromptsPrefab = null;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// put the stored settings here
|
// put the stored settings here
|
||||||
|
|
||||||
[Header("Build Settings")]
|
[Header(Localization.Translations.MenuItems.BuildSettings)]
|
||||||
[Tooltip("Should the Hot Reload runtime be included in development builds? HotReload is never included in release builds.")]
|
[Tooltip(Localization.Translations.MenuItems.IncludeInBuildTooltip)]
|
||||||
public bool IncludeInBuild = true;
|
public bool IncludeInBuild = true;
|
||||||
|
|
||||||
[Header("Player Settings")]
|
[Header(Localization.Translations.MenuItems.PlayerSettings)]
|
||||||
public bool AllowAndroidAppToMakeHttpRequests = false;
|
public bool AllowAndroidAppToMakeHttpRequests = false;
|
||||||
|
|
||||||
#region hidden
|
#region hidden
|
||||||
@@ -137,4 +110,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
#endregion settings
|
#endregion settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
using System.Net.Http;
|
||||||
using System.Net.Http;
|
|
||||||
|
|
||||||
namespace SingularityGroup.HotReload {
|
namespace SingularityGroup.HotReload {
|
||||||
|
|
||||||
@@ -15,5 +14,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
|
||||||
namespace SingularityGroup.HotReload {
|
namespace SingularityGroup.HotReload {
|
||||||
public interface IServerHealthCheck {
|
public interface IServerHealthCheck {
|
||||||
bool IsServerHealthy { get; }
|
bool IsServerHealthy { get; }
|
||||||
@@ -8,4 +7,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
void CheckHealth();
|
void CheckHealth();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
@@ -24,4 +23,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||||
#define MOBILE_ANDROID
|
#define MOBILE_ANDROID
|
||||||
#endif
|
#endif
|
||||||
@@ -61,4 +60,3 @@ namespace SingularityGroup.HotReload {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -7,7 +7,7 @@ PluginImporter:
|
|||||||
executionOrder: {}
|
executionOrder: {}
|
||||||
defineConstraints:
|
defineConstraints:
|
||||||
- ENABLE_MONO
|
- ENABLE_MONO
|
||||||
- DEVELOPMENT_BUILD
|
- DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||||
isPreloaded: 0
|
isPreloaded: 0
|
||||||
isOverridable: 1
|
isOverridable: 1
|
||||||
isExplicitlyReferenced: 1
|
isExplicitlyReferenced: 1
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ PluginImporter:
|
|||||||
defineConstraints:
|
defineConstraints:
|
||||||
- ENABLE_MONO
|
- ENABLE_MONO
|
||||||
- UNITY_2019_4_OR_NEWER
|
- UNITY_2019_4_OR_NEWER
|
||||||
- DEVELOPMENT_BUILD
|
- DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||||
isPreloaded: 0
|
isPreloaded: 0
|
||||||
isOverridable: 1
|
isOverridable: 1
|
||||||
isExplicitlyReferenced: 1
|
isExplicitlyReferenced: 1
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ PluginImporter:
|
|||||||
defineConstraints:
|
defineConstraints:
|
||||||
- ENABLE_MONO
|
- ENABLE_MONO
|
||||||
- UNITY_2020_3_OR_NEWER
|
- UNITY_2020_3_OR_NEWER
|
||||||
- DEVELOPMENT_BUILD
|
- DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||||
isPreloaded: 0
|
isPreloaded: 0
|
||||||
isOverridable: 1
|
isOverridable: 1
|
||||||
isExplicitlyReferenced: 1
|
isExplicitlyReferenced: 1
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ PluginImporter:
|
|||||||
defineConstraints:
|
defineConstraints:
|
||||||
- ENABLE_MONO
|
- ENABLE_MONO
|
||||||
- UNITY_2022_2_OR_NEWER
|
- UNITY_2022_2_OR_NEWER
|
||||||
- DEVELOPMENT_BUILD
|
- DEVELOPMENT_BUILD || UNITY_EDITOR
|
||||||
isPreloaded: 0
|
isPreloaded: 0
|
||||||
isOverridable: 1
|
isOverridable: 1
|
||||||
isExplicitlyReferenced: 1
|
isExplicitlyReferenced: 1
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 392d4a942d5d4d26872be33e375c8d32
|
||||||
|
timeCreated: 1759652490
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||||
|
namespace SingularityGroup.HotReload.Localization {
|
||||||
|
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Common {
|
||||||
|
public static string UnknownException;
|
||||||
|
public static string HotReloadIsRunning;
|
||||||
|
public static string HotReloadIsNotRunning;
|
||||||
|
public static string UnableToResolveMethod;
|
||||||
|
public static string UnableToResolveType;
|
||||||
|
public static string UnableToResolveField;
|
||||||
|
public static string HotReloadUnreachable;
|
||||||
|
public static string TryingToReconnect;
|
||||||
|
public static string Disconnected;
|
||||||
|
public static string Unknown;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
UnknownException = "unknown exception";
|
||||||
|
HotReloadIsRunning = "Hot Reload is running";
|
||||||
|
HotReloadIsNotRunning = "Hot Reload is not running";
|
||||||
|
UnableToResolveMethod = "Unable to resolve method";
|
||||||
|
UnableToResolveType = "Unable to resolve type";
|
||||||
|
UnableToResolveField = "Unable to resolve field";
|
||||||
|
HotReloadUnreachable = "Hot Reload was unreachable for 5 seconds, trying to reconnect...";
|
||||||
|
TryingToReconnect = "Trying to reconnect...";
|
||||||
|
Disconnected = "Disconnected";
|
||||||
|
Unknown = "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
UnknownException = "未知异常";
|
||||||
|
HotReloadIsRunning = "Hot Reload 正在运行";
|
||||||
|
HotReloadIsNotRunning = "Hot Reload 未运行";
|
||||||
|
UnableToResolveMethod = "无法解析方法";
|
||||||
|
UnableToResolveType = "无法解析类型";
|
||||||
|
UnableToResolveField = "无法解析字段";
|
||||||
|
HotReloadUnreachable = "Hot Reload 5 秒内无法访问,正在尝试重新连接...";
|
||||||
|
TryingToReconnect = "正在尝试重新连接...";
|
||||||
|
Disconnected = "已断开连接";
|
||||||
|
Unknown = "未知";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 71c2ede153664ef48b2919d3c42da1a3
|
||||||
|
timeCreated: 1762538401
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||||
|
namespace SingularityGroup.HotReload.Localization {
|
||||||
|
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Dialogs {
|
||||||
|
public static string Information;
|
||||||
|
public static string ContinueButtonText;
|
||||||
|
public static string CancelButtonText;
|
||||||
|
public static string DifferentProjectSummary;
|
||||||
|
public static string DifferentProjectSuggestion;
|
||||||
|
public static string DifferentCommitSummary;
|
||||||
|
public static string DifferentCommitSuggestion;
|
||||||
|
public static string ConnectionStateConnecting;
|
||||||
|
public static string ConnectionStateHandshaking;
|
||||||
|
public static string ConnectionStateDifferencesFound;
|
||||||
|
public static string ConnectionStateConnected;
|
||||||
|
public static string ConnectionStateCancelled;
|
||||||
|
public static string Patches;
|
||||||
|
public static string IsConnected;
|
||||||
|
public static string NoWiFiNetwork;
|
||||||
|
public static string WaitForCompiling;
|
||||||
|
public static string TargetNetworkIsReachable;
|
||||||
|
public static string AutoPairEncounteredIssue;
|
||||||
|
public static string ConnectionFailed;
|
||||||
|
public static string TryingToReconnect;
|
||||||
|
public static string Disconnected;
|
||||||
|
public static string PatchesStatus;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
Information = "Information";
|
||||||
|
ContinueButtonText = "Continue";
|
||||||
|
CancelButtonText = "Cancel";
|
||||||
|
DifferentProjectSummary = "Hot Reload was started from a different project";
|
||||||
|
DifferentProjectSuggestion = "Please run Hot Reload from the matching Unity project";
|
||||||
|
DifferentCommitSummary = "Editor and current build are on different commits";
|
||||||
|
DifferentCommitSuggestion = "This can cause errors when the build was made on an old commit.";
|
||||||
|
ConnectionStateConnecting = "Connecting ...";
|
||||||
|
ConnectionStateHandshaking = "Handshaking ...";
|
||||||
|
ConnectionStateDifferencesFound = "Differences found";
|
||||||
|
ConnectionStateConnected = "Connected!";
|
||||||
|
ConnectionStateCancelled = "Cancelled";
|
||||||
|
Patches = "Patches";
|
||||||
|
IsConnected = "Is this device connected to {0}?";
|
||||||
|
NoWiFiNetwork = "WiFi";
|
||||||
|
WaitForCompiling = "Wait for compiling to finish before trying again";
|
||||||
|
TargetNetworkIsReachable = "Make sure you're on the same {0} network. Also ensure Hot Reload is running";
|
||||||
|
AutoPairEncounteredIssue = "Auto-pair encountered an issue";
|
||||||
|
ConnectionFailed = "Connection failed";
|
||||||
|
TryingToReconnect = "Trying to reconnect ...";
|
||||||
|
Disconnected = "Disconnected";
|
||||||
|
PatchesStatus = "Patches: {0} pending, {1} applied";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
Information = "信息";
|
||||||
|
ContinueButtonText = "继续";
|
||||||
|
CancelButtonText = "取消";
|
||||||
|
DifferentProjectSummary = "Hot Reload 从不同的项目启动";
|
||||||
|
DifferentProjectSuggestion = "请从匹配的 Unity 项目运行 Hot Reload";
|
||||||
|
DifferentCommitSummary = "编辑器和当前构建在不同的提交上";
|
||||||
|
DifferentCommitSuggestion = "当构建是在旧的提交上进行时,这可能会导致错误。";
|
||||||
|
ConnectionStateConnecting = "正在连接 ...";
|
||||||
|
ConnectionStateHandshaking = "正在握手 ...";
|
||||||
|
ConnectionStateDifferencesFound = "发现差异";
|
||||||
|
ConnectionStateConnected = "已连接!";
|
||||||
|
ConnectionStateCancelled = "已取消";
|
||||||
|
Patches = "补丁";
|
||||||
|
IsConnected = "此设备是否已连接到 {0}?";
|
||||||
|
NoWiFiNetwork = "WiFi";
|
||||||
|
WaitForCompiling = "请等待编译完成后再试";
|
||||||
|
TargetNetworkIsReachable = "请确保您在同一个 {0} 网络中。还要确保 Hot Reload 正在运行";
|
||||||
|
AutoPairEncounteredIssue = "自动配对遇到问题";
|
||||||
|
ConnectionFailed = "连接失败";
|
||||||
|
TryingToReconnect = "正在尝试重新连接 ...";
|
||||||
|
Disconnected = "已断开连接";
|
||||||
|
PatchesStatus = "补丁:{0} 待处理,{1} 已应用";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3970cf8b2b8a47dd9d16ce5051375690
|
||||||
|
timeCreated: 1762538420
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||||
|
namespace SingularityGroup.HotReload.Localization {
|
||||||
|
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Errors {
|
||||||
|
public static string MethodNameMismatch;
|
||||||
|
public static string DeclaringTypeNameMismatch;
|
||||||
|
public static string IsGenericMethodDefinitionMismatch;
|
||||||
|
public static string MissingThisParameter;
|
||||||
|
public static string ThisParameterTypeMismatch;
|
||||||
|
public static string ParameterCountMismatch;
|
||||||
|
public static string ParameterTypeMismatch;
|
||||||
|
public static string ReturnTypeMismatch;
|
||||||
|
public static string GenericParameterNotGenericType;
|
||||||
|
public static string GenericParameterDidNotExist;
|
||||||
|
public static string IsPlayerWithHotReloadFalse;
|
||||||
|
public static string UnknownExceptionReadingBuildInfo;
|
||||||
|
public static string BuildInfoNotFound;
|
||||||
|
public static string FailedPromptsPrefab;
|
||||||
|
public static string HandshakeFailedInvalidBuildTarget;
|
||||||
|
public static string BuildTargetMismatch;
|
||||||
|
public static string UnableToResolveMethodInAssembly;
|
||||||
|
public static string UnableToResolveTypeInAssembly;
|
||||||
|
public static string UnableToResolveFieldInAssembly;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
MethodNameMismatch = "Method name mismatch";
|
||||||
|
DeclaringTypeNameMismatch = "Declaring type name mismatch";
|
||||||
|
IsGenericMethodDefinitionMismatch = "IsGenericMethodDefinition mismatch";
|
||||||
|
MissingThisParameter = "missing this parameter";
|
||||||
|
ThisParameterTypeMismatch = "this parameter type mismatch";
|
||||||
|
ParameterCountMismatch = "parameter count mismatch";
|
||||||
|
ParameterTypeMismatch = "parameter type mismatch";
|
||||||
|
ReturnTypeMismatch = "Return type mismatch";
|
||||||
|
GenericParameterNotGenericType = "Generic parameter did not resolve to generic type definition";
|
||||||
|
GenericParameterDidNotExist = "Generic parameter did not exist on the generic type definition";
|
||||||
|
IsPlayerWithHotReloadFalse = "IsPlayerWithHotReload() is false";
|
||||||
|
UnknownExceptionReadingBuildInfo = "Uknown exception happened when reading build info";
|
||||||
|
BuildInfoNotFound = "Uknown issue happened when reading build info.";
|
||||||
|
FailedPromptsPrefab = "Failed to find PromptsPrefab (are you using Hot Reload as a package?";
|
||||||
|
HandshakeFailedInvalidBuildTarget = "Server did not declare its current Unity activeBuildTarget in the handshake response. Will assume it is {0}.";
|
||||||
|
BuildTargetMismatch = "Your Unity project is running on {0}. You may need to switch it to {1} for Hot Reload to work.";
|
||||||
|
UnableToResolveMethodInAssembly = "Unable to resolve method {0} in assembly {1}";
|
||||||
|
UnableToResolveTypeInAssembly = "Unable to resolve type with name: {0} in assembly {1}";
|
||||||
|
UnableToResolveFieldInAssembly = "Unable to resolve field with name: {0} in assembly {1}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
MethodNameMismatch = "方法名称不匹配";
|
||||||
|
DeclaringTypeNameMismatch = "声明类型名称不匹配";
|
||||||
|
IsGenericMethodDefinitionMismatch = "IsGenericMethodDefinition 不匹配";
|
||||||
|
MissingThisParameter = "缺少 this 参数";
|
||||||
|
ThisParameterTypeMismatch = "this 参数类型不匹配";
|
||||||
|
ParameterCountMismatch = "参数数量不匹配";
|
||||||
|
ParameterTypeMismatch = "参数类型不匹配";
|
||||||
|
ReturnTypeMismatch = "返回类型不匹配";
|
||||||
|
GenericParameterNotGenericType = "泛型参数未解析为泛型类型定义";
|
||||||
|
GenericParameterDidNotExist = "泛型参数在泛型类型定义上不存在";
|
||||||
|
IsPlayerWithHotReloadFalse = "IsPlayerWithHotReload() 为 false";
|
||||||
|
UnknownExceptionReadingBuildInfo = "读取构建信息时发生未知异常";
|
||||||
|
BuildInfoNotFound = "读取构建信息时发生未知问题。";
|
||||||
|
FailedPromptsPrefab = "未能找到 PromptsPrefab(您是否将 Hot Reload 作为软件包使用?";
|
||||||
|
HandshakeFailedInvalidBuildTarget = "服务器在握手响应中未声明其当前的 Unity activeBuildTarget。将假定为 {0}。";
|
||||||
|
BuildTargetMismatch = "您的 Unity 项目正在 {0} 上运行。您可能需要将其切换到 {1} 才能使 Hot Reload 工作。";
|
||||||
|
UnableToResolveMethodInAssembly = "无法在程序集 {1} 中解析方法 {0}";
|
||||||
|
UnableToResolveTypeInAssembly = "无法在程序集 {1} 中解析名称为 {0} 的类型";
|
||||||
|
UnableToResolveFieldInAssembly = "无法在程序集 {1} 中解析名称为 {0} 的字段";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c96d2f0898524320839b84cf22fcd820
|
||||||
|
timeCreated: 1762538447
|
||||||
@@ -0,0 +1,178 @@
|
|||||||
|
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||||
|
namespace SingularityGroup.HotReload.Localization {
|
||||||
|
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Logging {
|
||||||
|
// Server and Connection
|
||||||
|
public static string HotReloadUnreachableDisconnecting;
|
||||||
|
public static string RequestHandshakeToServer;
|
||||||
|
public static string ServerHealthyAfterHandshake;
|
||||||
|
|
||||||
|
// Polling Errors
|
||||||
|
public static string PollMethodPatchesFailed;
|
||||||
|
public static string PollPatchStatusFailed;
|
||||||
|
public static string PollAssetChangesFailed;
|
||||||
|
|
||||||
|
// Request Errors
|
||||||
|
public static string DeserializingResponseFailed;
|
||||||
|
public static string RequestTimeout;
|
||||||
|
|
||||||
|
// Method Invocation
|
||||||
|
public static string InvokeOnHotReloadFailed;
|
||||||
|
public static string InvokeOnHotReloadLocalFailed;
|
||||||
|
|
||||||
|
// Build and Player
|
||||||
|
public static string HotReloadNotAvailableBuildSettings;
|
||||||
|
public static string BuildInfoNotFound;
|
||||||
|
|
||||||
|
// Method Compatibility
|
||||||
|
public static string UnknownIssue;
|
||||||
|
|
||||||
|
// Patch Loading/Saving
|
||||||
|
public static string LoadingPatchesFromDiskError;
|
||||||
|
public static string LoadingPatchesFromFile;
|
||||||
|
public static string LoadedPatchesFromDisk;
|
||||||
|
public static string SavingAppliedPatches;
|
||||||
|
|
||||||
|
// Patch Registration/Application
|
||||||
|
public static string RegisterPatches;
|
||||||
|
public static string ApplyPatchesPending;
|
||||||
|
public static string DetourMethod;
|
||||||
|
|
||||||
|
// Exceptions
|
||||||
|
public static string ExceptionHandlingMethodPatch;
|
||||||
|
public static string ExceptionApplyingPatch;
|
||||||
|
public static string ExceptionEnsureUnityEventMethod;
|
||||||
|
public static string ExceptionRemoveUnityEventMethod;
|
||||||
|
public static string InvalidPath;
|
||||||
|
|
||||||
|
// Field Operations
|
||||||
|
public static string FailedRegisteringInitializerInvalidMethod;
|
||||||
|
public static string FailedRegisteringInitializerException;
|
||||||
|
public static string FailedRegisteringNewFieldDefinitions;
|
||||||
|
public static string FailedRemovingInitializer;
|
||||||
|
public static string FailedRemovingFieldValue;
|
||||||
|
public static string FailedMovingFieldValue;
|
||||||
|
public static string FailedUpdatingFieldAttributes;
|
||||||
|
public static string FailedAddingFieldToInspector;
|
||||||
|
public static string FailedHidingFieldFromInspector;
|
||||||
|
|
||||||
|
// Method Patching
|
||||||
|
public static string DebuggerAttachedNotAllowed;
|
||||||
|
public static string MethodMismatch;
|
||||||
|
public static string FailedToApplyPatchForMethod;
|
||||||
|
public static string HotReloadApplyTook;
|
||||||
|
|
||||||
|
// Unity Events
|
||||||
|
public static string SceneLoadedWithNewUnityEventMethods;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
HotReloadUnreachableDisconnecting = "Hot Reload was unreachable for {0} seconds, disconnecting";
|
||||||
|
RequestHandshakeToServer = "Request handshake to Hot Reload server with hostname: {0}";
|
||||||
|
ServerHealthyAfterHandshake = "Server is healthy after first handshake? {0}";
|
||||||
|
|
||||||
|
PollMethodPatchesFailed = "PollMethodPatches failed with code {0} {1} {2}";
|
||||||
|
PollPatchStatusFailed = "PollPatchStatus failed with code {0} {1} {2}";
|
||||||
|
PollAssetChangesFailed = "PollAssetChanges failed with code {0} {1} {2}";
|
||||||
|
|
||||||
|
DeserializingResponseFailed = "Deserializing response failed with {0}: {1}";
|
||||||
|
RequestTimeout = "Request timeout";
|
||||||
|
|
||||||
|
InvokeOnHotReloadFailed = "[InvokeOnHotReload] {0} {1} failed. Exception:\n{2}";
|
||||||
|
InvokeOnHotReloadLocalFailed = "[InvokeOnHotReloadLocal] {0} {1} failed. Exception:\n{2}";
|
||||||
|
|
||||||
|
HotReloadNotAvailableBuildSettings = "Hot Reload is not available in this build because one or more build settings were not supported.";
|
||||||
|
BuildInfoNotFound = "Build info not found";
|
||||||
|
|
||||||
|
UnknownIssue = "unknown issue";
|
||||||
|
|
||||||
|
LoadingPatchesFromDiskError = "Encountered exception when loading patches from disk:";
|
||||||
|
LoadingPatchesFromFile = "Loading patches from file {0}";
|
||||||
|
LoadedPatchesFromDisk = "Loaded {0} patches from disk";
|
||||||
|
SavingAppliedPatches = "Saving {0} applied patches to {1}";
|
||||||
|
|
||||||
|
RegisterPatches = "Register patches.\nWarnings: {0} \nMethods:\n{1}";
|
||||||
|
ApplyPatchesPending = "ApplyPatches. {0} patches pending.";
|
||||||
|
DetourMethod = "Detour method {0:X8} {1}, offset: {2}";
|
||||||
|
|
||||||
|
ExceptionHandlingMethodPatch = "Exception occured when handling method patch. Exception:";
|
||||||
|
ExceptionApplyingPatch = "Edit requires full recompile to apply: Encountered exception when applying a patch.\nCommon causes: editing code that failed to patch previously, an unsupported change, or a real bug in Hot Reload.\nIf you think this is a bug, please report the issue on Discord and include a code-snippet before/after.";
|
||||||
|
ExceptionEnsureUnityEventMethod = "Encountered exception in EnsureUnityEventMethod: {0} {1}";
|
||||||
|
ExceptionRemoveUnityEventMethod = "Encountered exception in RemoveUnityEventMethod: {0} {1}";
|
||||||
|
InvalidPath = "Invalid path: {0}";
|
||||||
|
|
||||||
|
FailedRegisteringInitializerInvalidMethod = "Failed registering initializer for field {0} in {1}. Field value might not be initialized correctly. Invalid method.";
|
||||||
|
FailedRegisteringInitializerException = "Failed registering initializer for field {0} in {1}. Field value might not be initialized correctly. Exception: {2}";
|
||||||
|
FailedRegisteringNewFieldDefinitions = "Failed registering new field definitions for field {0} in {1}. Exception: {2}";
|
||||||
|
FailedRemovingInitializer = "Failed removing initializer for field {0} in {1}. Field value might not be initialized correctly. Exception: {2}";
|
||||||
|
FailedRemovingFieldValue = "Failed removing field value from {0} in {1}. Field value in code might not be up to date. Exception: {2}";
|
||||||
|
FailedMovingFieldValue = "Failed moving field value from {0} to {1} in {2}. Field value in code might not be up to date. Exception: {3}";
|
||||||
|
FailedUpdatingFieldAttributes = "Failed updating field attributes of {0} in {1}. Updates might not reflect in the inspector. Exception: {2}";
|
||||||
|
FailedAddingFieldToInspector = "Failed adding field {0}:{1} to the inspector. Field will not be displayed. Exception: {2}";
|
||||||
|
FailedHidingFieldFromInspector = "Failed hiding field {0}:{1} from the inspector. Exception: {2}";
|
||||||
|
|
||||||
|
DebuggerAttachedNotAllowed = "Patching methods is not allowed while the Debugger is attached. You can change this behavior in settings if Hot Reload is compatible with the debugger you're running.";
|
||||||
|
MethodMismatch = "Edit requires full recompile to apply: Method mismatch: {0}, patch: {1}. \nCommon causes: editing code that failed to patch previously, an unsupported change, or a real bug in Hot Reload.\nIf you think this is a bug, please report the issue on Discord and include a code-snippet before/after.";
|
||||||
|
FailedToApplyPatchForMethod = "Edit requires full recompile to apply: Failed to apply patch for method {0} in assembly {1}.\nCommon causes: editing code that failed to patch previously, an unsupported change, or a real bug in Hot Reload.\nIf you think this is a bug, please report the issue on Discord and include a code-snippet before/after.\nException: {2}";
|
||||||
|
HotReloadApplyTook = "Hot Reload apply took {0}";
|
||||||
|
|
||||||
|
SceneLoadedWithNewUnityEventMethods = "A new Scene was loaded while new unity event methods were added at runtime. MonoBehaviours in the Scene will not trigger these new events.";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
HotReloadUnreachableDisconnecting = "Hot Reload {0} 秒内无法访问,正在断开连接";
|
||||||
|
RequestHandshakeToServer = "向 Hot Reload 服务器请求握手,主机名:{0}";
|
||||||
|
ServerHealthyAfterHandshake = "第一次握手后服务器是否健康?{0}";
|
||||||
|
|
||||||
|
PollMethodPatchesFailed = "PollMethodPatches 失败,代码 {0} {1} {2}";
|
||||||
|
PollPatchStatusFailed = "PollPatchStatus 失败,代码 {0} {1} {2}";
|
||||||
|
PollAssetChangesFailed = "PollAssetChanges 失败,代码 {0} {1} {2}";
|
||||||
|
|
||||||
|
DeserializingResponseFailed = "反序列化响应失败,{0}:{1}";
|
||||||
|
RequestTimeout = "请求超时";
|
||||||
|
|
||||||
|
InvokeOnHotReloadFailed = "[InvokeOnHotReload] {0} {1} 失败。异常:\n{2}";
|
||||||
|
InvokeOnHotReloadLocalFailed = "[InvokeOnHotReloadLocal] {0} {1} 失败。异常:\n{2}";
|
||||||
|
|
||||||
|
HotReloadNotAvailableBuildSettings = "由于一个或多个构建设置不受支持,Hot Reload 在此构建中不可用。";
|
||||||
|
BuildInfoNotFound = "未找到构建信息";
|
||||||
|
|
||||||
|
UnknownIssue = "未知问题";
|
||||||
|
|
||||||
|
LoadingPatchesFromDiskError = "从磁盘加载补丁时遇到异常:";
|
||||||
|
LoadingPatchesFromFile = "从文件 {0} 加载补丁";
|
||||||
|
LoadedPatchesFromDisk = "从磁盘加载了 {0} 个补丁";
|
||||||
|
SavingAppliedPatches = "将 {0} 个已应用的补丁保存到 {1}";
|
||||||
|
|
||||||
|
RegisterPatches = "注册补丁。\n警告:{0} \n方法:\n{1}";
|
||||||
|
ApplyPatchesPending = "ApplyPatches。{0} 个补丁待处理。";
|
||||||
|
DetourMethod = "Detour 方法 {0:X8} {1},偏移量:{2}";
|
||||||
|
|
||||||
|
ExceptionHandlingMethodPatch = "处理方法补丁时发生异常。异常:";
|
||||||
|
ExceptionApplyingPatch = "编辑需要完全重新编译才能应用:应用补丁时遇到异常。\n常见原因:编辑之前修补失败的代码、不支持的更改或 Hot Reload 中的真正错误。\n如果您认为这是一个错误,请在 Discord 上报告问题并附上之前/之后的代码片段。";
|
||||||
|
ExceptionEnsureUnityEventMethod = "在 EnsureUnityEventMethod 中遇到异常:{0} {1}";
|
||||||
|
ExceptionRemoveUnityEventMethod = "在 RemoveUnityEventMethod 中遇到异常:{0} {1}";
|
||||||
|
InvalidPath = "无效路径:{0}";
|
||||||
|
|
||||||
|
FailedRegisteringInitializerInvalidMethod = "在 {1} 中为字段 {0} 注册初始化程序失败。字段值可能未正确初始化。方法无效。";
|
||||||
|
FailedRegisteringInitializerException = "在 {1} 中为字段 {0} 注册初始化程序失败。字段值可能未正确初始化。异常:{2}";
|
||||||
|
FailedRegisteringNewFieldDefinitions = "在 {1} 中为字段 {0} 注册新字段定义失败。异常:{2}";
|
||||||
|
FailedRemovingInitializer = "在 {1} 中为字段 {0} 删除初始化程序失败。字段值可能未正确初始化。异常:{2}";
|
||||||
|
FailedRemovingFieldValue = "从 {1} 中的 {0} 删除字段值失败。代码中的字段值可能不是最新的。异常:{2}";
|
||||||
|
FailedMovingFieldValue = "在 {2} 中将字段值从 {0} 移动到 {1} 失败。代码中的字段值可能不是最新的。异常:{3}";
|
||||||
|
FailedUpdatingFieldAttributes = "在 {1} 中更新 {0} 的字段属性失败。更新可能不会反映在检查器中。异常:{2}";
|
||||||
|
FailedAddingFieldToInspector = "将字段 {0}:{1} 添加到检查器失败。字段将不会显示。异常:{2}";
|
||||||
|
FailedHidingFieldFromInspector = "从检查器中隐藏字段 {0}:{1} 失败。异常:{2}";
|
||||||
|
|
||||||
|
DebuggerAttachedNotAllowed = "附加调试器时不允许修补方法。如果 Hot Reload 与您正在运行的调试器兼容,您可以在设置中更改此行为。";
|
||||||
|
MethodMismatch = "编辑需要完全重新编译才能应用:方法不匹配:{0},补丁:{1}。\n常见原因:编辑之前修补失败的代码、不支持的更改或 Hot Reload 中的真正错误。\n如果您认为这是一个错误,请在 Discord 上报告问题并附上之前/之后的代码片段。";
|
||||||
|
FailedToApplyPatchForMethod = "编辑需要完全重新编译才能应用:为程序集 {1} 中的方法 {0} 应用补丁失败。\n常见原因:编辑之前修补失败的代码、不支持的更改或 Hot Reload 中的真正错误。\n如果您认为这是一个错误,请在 Discord 上报告问题并附上之前/之后的代码片段。\n异常:{2}";
|
||||||
|
HotReloadApplyTook = "Hot Reload 应用耗时 {0}";
|
||||||
|
|
||||||
|
SceneLoadedWithNewUnityEventMethods = "在运行时添加新的 unity 事件方法时加载了新场景。场景中的 MonoBehaviours 不会触发这些新事件。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bbabe74466b6cb84bb5d2e98d9779397
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||||
|
namespace SingularityGroup.HotReload.Localization {
|
||||||
|
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class MenuItems {
|
||||||
|
public const string UIControls = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "UI 控件" : "UI controls";
|
||||||
|
public const string Information = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "信息" : "Information";
|
||||||
|
public const string Other = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "其他" : "Other";
|
||||||
|
public const string FalllbackEventSystem = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "当项目未能及早创建 EventSystem 时使用" : "Used when project does not create an EventSystem early enough";
|
||||||
|
public const string BuildSettings = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "构建设置" : "Build Settings";
|
||||||
|
public const string IncludeInBuildTooltip = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "Hot Reload 运行时是否应包含在开发版本中?HotReload 永远不会包含在发布版本中。" : "Should the Hot Reload runtime be included in development builds? HotReload is never included in release builds.";
|
||||||
|
public const string PlayerSettings = PackageConst.DefaultLocale == Locale.SimplifiedChinese ? "播放器设置" : "Player Settings";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 12be1a0b0b06402da21c46ae29d60746
|
||||||
|
timeCreated: 1762675925
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
|
||||||
|
namespace SingularityGroup.HotReload.Localization {
|
||||||
|
|
||||||
|
internal static partial class Translations {
|
||||||
|
public static class Settings {
|
||||||
|
public static string BuildSettings;
|
||||||
|
public static string IncludeInBuildTooltip;
|
||||||
|
public static string PlayerSettings;
|
||||||
|
public static string Other;
|
||||||
|
public static string FallbackEventSystemTooltip;
|
||||||
|
public static string NoEventSystemWarning;
|
||||||
|
|
||||||
|
public static void LoadEnglish() {
|
||||||
|
BuildSettings = "Build Settings";
|
||||||
|
IncludeInBuildTooltip = "Should the Hot Reload runtime be included in development builds? HotReload is never included in release builds.";
|
||||||
|
PlayerSettings = "Player Settings";
|
||||||
|
Other = "Other";
|
||||||
|
FallbackEventSystemTooltip = "Used when project does not create an EventSystem early enough";
|
||||||
|
NoEventSystemWarning = "No EventSystem is active, enabling an EventSystem inside Hot Reload {0} prefab. A Unity EventSystem and an Input module is required for tapping buttons on the Unity UI.";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LoadSimplifiedChinese() {
|
||||||
|
BuildSettings = "构建设置";
|
||||||
|
IncludeInBuildTooltip = "Hot Reload 运行时是否应包含在开发版本中?HotReload 永远不会包含在发布版本中。";
|
||||||
|
PlayerSettings = "播放器设置";
|
||||||
|
Other = "其他";
|
||||||
|
FallbackEventSystemTooltip = "当项目未能及早创建 EventSystem 时使用";
|
||||||
|
NoEventSystemWarning = "没有活动的 EventSystem,正在 Hot Reload {0} 预制件内启用 EventSystem。点击 Unity UI 上的按钮需要 Unity EventSystem 和输入模块。";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0fe4b08bd0d64689be16dc995c89bf1a
|
||||||
|
timeCreated: 1762538464
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user