perf(save): encode detached snapshots and expose phase timings
Publish UPM package / publish (push) Successful in 2s
Publish NuGet packages / publish (push) Successful in 2m31s

This commit is contained in:
2026-09-29 10:14:43 +08:00
parent d26f1a94ef
commit cdb682f484
6 changed files with 65 additions and 19 deletions
+13
View File
@@ -59,8 +59,21 @@ namespace ShrinkDataSaver
}
public sealed class SavePhaseTimings
{
public double CaptureMilliseconds { get; internal set; }
public double EncodeMilliseconds { get; internal set; }
public double EncryptMilliseconds { get; internal set; }
public double WriteMilliseconds { get; internal set; }
public long EncodedBytes { get; internal set; }
}
public class SaveOptions
{
/// <summary>Only the detached JToken snapshot is encoded off-thread; module capture stays on the caller thread.</summary>
public bool EncodeInBackground = false;
public bool CollectTimings = false;
public SavePhaseTimings LastTimings { get; internal set; }
public string SlotName = "New Save";
public bool CaptureScreenshot = false;
#if UNITY_5_3_OR_NEWER