savya #14

Merged
savya merged 108 commits from savya into main 2026-07-07 09:55:51 +02:00
2 changed files with 13 additions and 0 deletions
Showing only changes of commit e821d4e65e - Show all commits

View File

@@ -48,6 +48,7 @@ namespace Darkmatter.Services.Capture
disabledCanvases = DisableOtherRootCanvases(paperCanvas);
disabledGraphics = HideNonPaperGraphics(paperRT);
HidePaperOwnGraphics(paperRT, disabledGraphics);
cam.clearFlags = CameraClearFlags.SolidColor;
cam.backgroundColor = new Color(0f, 0f, 0f, 0f);
@@ -157,6 +158,18 @@ namespace Darkmatter.Services.Capture
return disabled;
}
private static void HidePaperOwnGraphics(Transform paper, List<UnityEngine.UI.Graphic> disabled)
{
if (paper == null) return;
var graphics = paper.GetComponents<UnityEngine.UI.Graphic>();
foreach (var g in graphics)
{
if (g == null || !g.enabled) continue;
g.enabled = false;
disabled.Add(g);
}
}
private static Rect ComputeCropRect(GameObject target, int screenW, int screenH)
{
if (target == null || target.transform is not RectTransform rt)

Binary file not shown.