maint: hotreload updated to 1.13.7

This commit is contained in:
Chris
2026-01-06 22:42:15 -05:00
parent 796dbca5d8
commit 105da8850a
128 changed files with 3538 additions and 738 deletions

View File

@@ -1,4 +1,3 @@
#if ENABLE_MONO && (DEVELOPMENT_BUILD || UNITY_EDITOR)
#if UNITY_ANDROID && !UNITY_EDITOR
#define MOBILE_ANDROID
#endif
@@ -18,6 +17,7 @@ using UnityEngine.Networking;
using UnityEngine;
using Debug = UnityEngine.Debug;
using System.IO;
using SingularityGroup.HotReload.Localization;
namespace SingularityGroup.HotReload {
// entrypoint for Unity Player builds. Not necessary in Unity Editor.
@@ -42,10 +42,11 @@ namespace SingularityGroup.HotReload {
bool onlyPrefabMissing;
if (!IsPlayerWithHotReload(out onlyPrefabMissing)) {
if (onlyPrefabMissing) {
Log.Warning("Hot Reload is not available in this build because one or more build settings were not supported.");
Log.Warning(Localization.Translations.Logging.HotReloadNotAvailableBuildSettings);
}
return;
}
Translations.LoadDefaultLocalization();
TryAutoConnect().Forget();
}
@@ -55,14 +56,14 @@ namespace SingularityGroup.HotReload {
buildInfo = await GetBuildInfo();
} catch (Exception e) {
if (e is IOException) {
Log.Warning("Hot Reload is not available in this build because one or more build settings were not supported.");
Log.Warning(Localization.Translations.Logging.HotReloadNotAvailableBuildSettings);
} else {
Log.Error($"Uknown exception happened when reading build info\n{e.GetType().Name}: {e.Message}");
Log.Error($"{Localization.Translations.Errors.UnknownExceptionReadingBuildInfo}\n{e.GetType().Name}: {e.Message}");
}
return;
}
if (buildInfo == null) {
Log.Error($"Uknown issue happened when reading build info.");
Log.Error(Localization.Translations.Errors.BuildInfoNotFound);
return;
}
@@ -92,7 +93,7 @@ namespace SingularityGroup.HotReload {
public static Task TryConnectToIpAndPort(string ip, int port) {
ip = ip.Trim();
if (buildInfo == null) {
throw new ArgumentException("Build info not found");
throw new ArgumentException(Localization.Translations.Logging.BuildInfoNotFound);
}
buildInfo.buildMachineHostName = ip;
buildInfo.buildMachinePort = port;
@@ -115,7 +116,7 @@ namespace SingularityGroup.HotReload {
PlayerCodePatcher.UpdateHost(null).Forget();
}
Log.Info($"Server is healthy after first handshake? {handshakeOk}");
Log.Info(string.Format(Localization.Translations.Logging.ServerHealthyAfterHandshake, handshakeOk));
}
/// on Android, streaming assets are inside apk zip, which can only be read using unity web request
@@ -158,4 +159,3 @@ namespace SingularityGroup.HotReload {
}
}
}
#endif