[Add] Hot Reload

This commit is contained in:
2026-02-27 03:16:18 +07:00
parent 5067cb51a1
commit b37579153b
431 changed files with 43054 additions and 1 deletions
@@ -0,0 +1,18 @@
using System;
namespace SingularityGroup.HotReload.Editor {
static class ExponentialBackoff {
public static TimeSpan GetTimeout(int attempt, int minBackoff = 250, int maxBackoff = 60000, int deltaBackoff = 400) {
attempt = Math.Min(25, attempt); // safety to avoid overflow below
var delta = (uint)(
(Math.Pow(2.0, attempt) - 1.0)
* deltaBackoff
);
var interval = Math.Min(checked(minBackoff + delta), maxBackoff);
return TimeSpan.FromMilliseconds(interval);
}
}
}