background fixes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user