added hotreload

This commit is contained in:
2025-07-17 19:17:27 +02:00
parent faf4bd1ca9
commit 12e3b85770
380 changed files with 39434 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using System;
using SingularityGroup.HotReload.Editor.Cli;
using UnityEditor;
using UnityEditor.Build;
namespace SingularityGroup.HotReload.Editor {
#pragma warning disable CS0618
class PostbuildSendProjectState : IPostprocessBuild {
#pragma warning restore CS0618
public int callbackOrder => 9999;
public void OnPostprocessBuild(BuildTarget target, string path) {
try {
if (!HotReloadBuildHelper.IncludeInThisBuild()) {
return;
}
// after build passes, need to send again because EditorApplication.delayCall isn't called.
var buildInfo = BuildInfoHelper.GenerateBuildInfoMainThread();
HotReloadCli.PrepareBuildInfo(buildInfo);
} catch (BuildFailedException) {
throw;
} catch (Exception e) {
throw new BuildFailedException(e);
}
}
}
}