Skip to content

fix: include UI Toolkit overlays in game_view screenshots with include_image#1040

Open
KennerMiner wants to merge 2 commits intoCoplayDev:betafrom
KennerMiner:feature/game-view-uitoolkit-screenshot-capture
Open

fix: include UI Toolkit overlays in game_view screenshots with include_image#1040
KennerMiner wants to merge 2 commits intoCoplayDev:betafrom
KennerMiner:feature/game-view-uitoolkit-screenshot-capture

Conversation

@KennerMiner
Copy link
Copy Markdown

@KennerMiner KennerMiner commented Apr 6, 2026

Summary

Fix the Play Mode game_view screenshot path used when include_image=true so the returned inline image includes UI Toolkit overlays.

Problem

When manage_scene(action="screenshot", capture_source="game_view", include_image=true) is used without an explicit camera target, the previous implementation captured the image through camera rendering.

That misses UI Toolkit overlays because UI Toolkit is composited after the camera render.

Change

  • Use ScreenCapture.CaptureScreenshotAsTexture() for game_view screenshots when:
    • include_image=true
    • Play Mode is active
    • no explicit camera target is requested
  • Keep existing behavior for:
    • explicit camera screenshots
    • non-Play-Mode include_image screenshots
    • screenshots where include_image is omitted or false

Validation

  • Diff is limited to:
    • MCPForUnity/Editor/Tools/ManageScene.cs
    • MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs
  • No package, lockfile, or unrelated tool changes included
  • Branch is based on beta

Notes

This PR intentionally keeps the fix narrow to the inline-image screenshot path.

Closes #1039.

Summary by Sourcery

Update game view screenshot capture to use composited frame grabs for inline images while preserving existing camera-based workflows.

Bug Fixes:

  • Ensure Play Mode game_view screenshots with include_image capture UI Toolkit overlays by using composited frame capture instead of camera rendering when no explicit camera is specified.

Enhancements:

  • Introduce a composited screenshot helper that leverages ScreenCapture.CaptureScreenshotAsTexture with a camera-based fallback and optional downscaling/base64 encoding for inline images.

Summary by CodeRabbit

  • New Features

    • Composited screenshot capture that includes UI overlays during Play mode.
    • Optionally embed captured image data (Base64) with downscaling when exceeding resolution limits.
    • Safer capture behavior when no explicit camera is set, with clear fallback strategies.
  • Bug Fixes

    • Improved capture control flow between Play and Editor modes with clearer error messaging.
    • More reliable camera fallback handling when target camera is unavailable.

Use ScreenCapture.CaptureScreenshotAsTexture() for game_view screenshots
when include_image=true and in Play mode. This captures the final composited
frame including UI Toolkit overlays, which camera.Render() misses since
UI Toolkit renders at the compositor level after camera rendering.

The camera-based path is still used when a specific camera is requested
or when not in Play mode.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 6, 2026

Reviewer's Guide

Adjusts game_view screenshot capture when include_image is requested to use a composited ScreenCapture path in Play Mode (so UI Toolkit overlays are included), while preserving camera-based capture behavior for explicit camera targets and non-Play-Mode screenshots.

Sequence diagram for include_image game_view screenshot in Play Mode

sequenceDiagram
    actor Caller
    participant ManageScene as ManageScene_CaptureScreenshot
    participant ScreenshotUtility
    participant ScreenCapture
    participant FileIO as FileSystem

    Caller->>ManageScene: manage_scene(action=screenshot, capture_source=game_view, include_image=true)
    ManageScene->>ManageScene: Resolve targetCamera
    alt targetCamera is not null
        ManageScene->>ManageScene: EnsureGameView
        ManageScene->>ScreenshotUtility: CaptureFromCameraToAssetsFolder(targetCamera, fileName, superSize, ensureUniqueFileName, includeImage, maxResolution)
        ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult(result)
    else targetCamera is null and includeImage true and Application.isPlaying true
        ManageScene->>ManageScene: EnsureGameView
        ManageScene->>ScreenshotUtility: CaptureComposited(fileName, superSize, ensureUniqueFileName, includeImage=true, maxResolution)
        ScreenshotUtility->>ScreenCapture: CaptureScreenshotAsTexture(superSize)
        ScreenCapture-->>ScreenshotUtility: Texture2D(tex)
        alt tex is null
            ScreenshotUtility->>ScreenshotUtility: Get Camera.main
            alt Camera.main not null
                ScreenshotUtility->>ScreenshotUtility: CaptureFromCameraToAssetsFolder(Camera.main, fileName, superSize, ensureUniqueFileName, includeImage, maxResolution)
                ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult(result)
            else Camera.main null
                ScreenshotUtility-->>ManageScene: throw InvalidOperationException
            end
        else tex is valid
            ScreenshotUtility->>ScreenshotUtility: EncodeToPNG(tex)
            ScreenshotUtility->>FileIO: WriteAllBytes(result.FullPath, png)
            alt includeImage true
                ScreenshotUtility->>ScreenshotUtility: Optional downscale and base64 encode
            end
            ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult(result)
        end
    else includeImage true and not Application.isPlaying
        ManageScene->>ManageScene: Find Camera.main or any Camera
        alt camera found
            ManageScene->>ManageScene: EnsureGameView
            ManageScene->>ScreenshotUtility: CaptureFromCameraToAssetsFolder(targetCamera, fileName, superSize, ensureUniqueFileName, includeImage=true, maxResolution)
            ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult(result)
        else no camera found
            ManageScene-->>Caller: ErrorResponse(No camera found outside Play mode)
        end
    else includeImage false
        ManageScene->>ScreenshotUtility: Existing non inline image capture path
        ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult(result)
    end

    opt success with image
        ManageScene->>ManageScene: ImportAsset(result.AssetsRelativePath)
        ManageScene-->>Caller: SuccessResponse(path, imageBase64, metadata)
    end
Loading

Class diagram for ScreenshotUtility composited capture changes

classDiagram
    class ScreenshotUtility {
        +ScreenshotCaptureResult CaptureFromCameraToAssetsFolder(Camera targetCamera, string fileName, int superSize, bool ensureUniqueFileName, bool includeImage, int maxResolution)
        +ScreenshotCaptureResult CaptureComposited(string fileName, int superSize, bool ensureUniqueFileName, bool includeImage, int maxResolution)
        -ScreenshotCaptureResult PrepareCaptureResult(string fileName, int superSize, bool ensureUniqueFileName, bool isAsync)
        -Texture2D DownscaleTexture(Texture2D source, int maxResolution)
        -void DestroyTexture(Texture2D texture)
    }

    class ScreenshotCaptureResult {
        +string FullPath
        +string AssetsRelativePath
        +int SuperSize
        +bool IsAsync
        +string ImageBase64
        +int ImageWidth
        +int ImageHeight
        +ScreenshotCaptureResult(string fullPath, string assetsRelativePath, int superSize, bool isAsync, string imageBase64, int imageWidth, int imageHeight)
    }

    class Camera {
        +string name
        +static Camera main
    }

    class ScreenCapture {
        +static Texture2D CaptureScreenshotAsTexture(int superSize)
    }

    class Texture2D {
        +int width
        +int height
        +byte[] EncodeToPNG()
    }

    class FileSystem {
        +static void WriteAllBytes(string path, byte[] bytes)
    }

    ScreenshotUtility --> ScreenshotCaptureResult : returns
    ScreenshotUtility --> Camera : uses
    ScreenshotUtility --> ScreenCapture : uses
    ScreenshotUtility --> Texture2D : creates
    ScreenshotUtility --> FileSystem : writes PNG files
Loading

File-Level Changes

Change Details Files
Route include_image game_view screenshots without an explicit camera in Play Mode through a new composited capture path instead of always using camera-based capture.
  • Split the screenshot capture branching so explicit camera targets always use camera-based capture, independent of include_image.
  • Add a Play-Mode-only branch for include_image game_view screenshots that calls a new ScreenshotUtility.CaptureComposited helper and returns inline image data when available.
  • Retain a non-Play-Mode include_image path that resolves a camera (main or first found) and errors if none is available, with updated error messaging.
MCPForUnity/Editor/Tools/ManageScene.cs
Introduce a composited screenshot helper that uses ScreenCapture.CaptureScreenshotAsTexture and optionally returns downscaled inline PNG data.
  • Implement CaptureComposited to capture the fully composited frame (including UI Toolkit), save it to disk, and optionally compute base64 PNG image data with maxResolution-aware downscaling.
  • Add a fallback path that uses camera-based CaptureFromCameraToAssetsFolder when ScreenCapture returns null but a main camera exists, otherwise throws a descriptive error.
  • Ensure captured textures are properly destroyed to avoid memory leaks, and preserve existing ScreenshotCaptureResult semantics when includeImage is false or image generation fails.
MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#1039 For manage_scene(action="screenshot", capture_source="game_view", include_image=true) in Play Mode without an explicit camera, capture the final composited frame (including UI Toolkit overlays) instead of a raw camera render.
#1039 Preserve existing behavior for other screenshot paths, including explicit camera screenshots, non-Play-Mode include_image screenshots, and screenshots where include_image is omitted or false.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cd30b013-9e05-4c73-8a7b-870f29b93087

📥 Commits

Reviewing files that changed from the base of the PR and between 0310606 and 369695c.

📒 Files selected for processing (2)
  • MCPForUnity/Editor/Tools/ManageScene.cs
  • MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs
🚧 Files skipped from review as they are similar to previous changes (2)
  • MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs
  • MCPForUnity/Editor/Tools/ManageScene.cs

📝 Walkthrough

Walkthrough

CaptureScreenshot now chooses composited frame capture in Play mode when inline images are requested and no explicit camera is specified; explicit camera requests still use camera-based capture. A new ScreenshotUtility.CaptureComposited(...) was added with fallbacks and optional inline Base64 image encoding.

Changes

Cohort / File(s) Summary
ManageScene: screenshot branching
MCPForUnity/Editor/Tools/ManageScene.cs
Changed CaptureScreenshot to: use CaptureFromCameraToAssetsFolder when targetCamera is resolved; use CaptureComposited when includeImage is true in Play mode and no explicit camera; otherwise fall back to camera capture outside Play mode. Adjusted import flags (ForceSynchronousImport) and response payload construction (new BuildScreenshotResponseData(...)) to include imageBase64/dimensions only when appropriate and set camera to camera name or "composited" accordingly.
ScreenshotUtility: composited capture
MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs
Added public static ScreenshotCaptureResult CaptureComposited(...) which calls ScreenCapture.CaptureScreenshotAsTexture(...), writes PNG to disk, optionally returns Base64 (with downscaling when > maxResolution), ensures Texture2D cleanup, and falls back to camera-based capture (or throws) when composited API is unavailable or returns null.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ManageScene
    participant ScreenshotUtility
    participant ScreenCapture
    participant Camera
    participant AssetDB

    Client->>ManageScene: manage_scene(action="screenshot", includeImage, targetCamera?)
    ManageScene-->>ManageScene: decide capture strategy
    alt explicit targetCamera resolved
        ManageScene->>ScreenshotUtility: CaptureFromCameraToAssetsFolder(camera)
        ScreenshotUtility->>Camera: render & read pixels
        ScreenshotUtility->>AssetDB: write file + ImportAsset(ForceSynchronousImport)
        ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult (maybe imageBase64)
    else includeImage && Application.isPlaying
        ManageScene->>ScreenshotUtility: CaptureComposited(...)
        ScreenshotUtility->>ScreenCapture: CaptureScreenshotAsTexture()
        alt ScreenCapture returned texture
            ScreenshotUtility->>AssetDB: write file + ImportAsset(ForceSynchronousImport)
            ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult (maybe imageBase64)
        else fallback to camera
            ScreenshotUtility->>Camera: CaptureFromCameraToAssetsFolder(camera)
            ScreenshotUtility->>AssetDB: write file + ImportAsset(ForceSynchronousImport)
            ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult
        end
    else (no Play mode, no explicit camera)
        ManageScene->>ScreenshotUtility: CaptureFromCameraToAssetsFolder(Camera.main or first)
        ScreenshotUtility->>Camera: render & read pixels
        ScreenshotUtility->>AssetDB: write file + ImportAsset(ForceSynchronousImport)
        ScreenshotUtility-->>ManageScene: ScreenshotCaptureResult
    end
    ManageScene-->>Client: response JSON (camera, path, optional imageBase64/dimensions)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰
I hopped through frames both near and wide,
Composited magic now sits by my side,
Overlays snug in the final sight,
Fallbacks ready when ScreenCapture takes flight,
Cheery pixels, bundled just right 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: fixing game_view screenshots to include UI Toolkit overlays when include_image is enabled.
Description check ✅ Passed The description comprehensively covers the problem, solution, validation, and scope with clear formatting matching the template structure and addressing all key sections.
Linked Issues check ✅ Passed The code changes fully address the requirements in issue #1039: composited capture is used for Play Mode game_view screenshots with include_image, while existing behavior is preserved for other paths.
Out of Scope Changes check ✅ Passed All changes are scoped to the two specified files and directly support the objective of including UI Toolkit overlays in composited game_view captures.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The success response construction for camera-based and composited captures in CaptureScreenshot is nearly identical; consider extracting a small helper to build the SuccessResponse/data dictionary to reduce duplication and keep the two paths in sync.
  • In ScreenshotUtility.CaptureComposited, the InvalidOperationException when both ScreenCapture and Camera.main are unavailable will bubble up differently than the camera-based paths that return error responses; consider aligning the error-handling strategy so callers see consistent behavior in failure cases.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The success response construction for camera-based and composited captures in `CaptureScreenshot` is nearly identical; consider extracting a small helper to build the `SuccessResponse`/data dictionary to reduce duplication and keep the two paths in sync.
- In `ScreenshotUtility.CaptureComposited`, the `InvalidOperationException` when both `ScreenCapture` and `Camera.main` are unavailable will bubble up differently than the camera-based paths that return error responses; consider aligning the error-handling strategy so callers see consistent behavior in failure cases.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs (1)

231-298: New CaptureComposited method looks well-structured with proper resource cleanup.

Two observations for robustness:

  1. Module availability check missing: Unlike CaptureToAssetsFolder (line 111), this method calls ScreenCapture.CaptureScreenshotAsTexture directly without first checking IsScreenCaptureModuleAvailable. If the Screen Capture module is disabled, this could throw instead of gracefully falling back.

  2. Fallback uses only Camera.main: The fallback at line 254 only checks Camera.main, whereas CaptureWithCameraFallback (line 135) uses FindAvailableCamera() which also searches for any camera in the scene. Consider using the same pattern for consistency.

Suggested improvements
         public static ScreenshotCaptureResult CaptureComposited(
             string fileName = null,
             int superSize = 1,
             bool ensureUniqueFileName = true,
             bool includeImage = false,
             int maxResolution = 0)
         {
+            // Early fallback if ScreenCapture module is unavailable
+            if (!IsScreenCaptureModuleAvailable)
+            {
+                var cam = FindAvailableCamera();
+                if (cam != null)
+                    return CaptureFromCameraToAssetsFolder(cam, fileName, superSize, ensureUniqueFileName, includeImage, maxResolution);
+                throw new InvalidOperationException("ScreenCapture module is unavailable and no fallback camera found.");
+            }
+
             ScreenshotCaptureResult result = PrepareCaptureResult(fileName, superSize, ensureUniqueFileName, isAsync: false);
             Texture2D tex = null;
             Texture2D downscaled = null;
             string imageBase64 = null;
             int imgW = 0, imgH = 0;
             try
             {
                 tex = ScreenCapture.CaptureScreenshotAsTexture(result.SuperSize);
                 if (tex == null)
                 {
                     // Fallback to camera-based if ScreenCapture fails
-                    var cam = Camera.main;
+                    var cam = FindAvailableCamera();
                     if (cam != null)
                         return CaptureFromCameraToAssetsFolder(cam, fileName, superSize, ensureUniqueFileName, includeImage, maxResolution);
                     throw new InvalidOperationException("ScreenCapture.CaptureScreenshotAsTexture returned null and no fallback camera available.");
                 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs` around lines 231 - 298, The
method CaptureComposited calls ScreenCapture.CaptureScreenshotAsTexture directly
and only falls back to Camera.main; update it to first check
IsScreenCaptureModuleAvailable (like CaptureToAssetsFolder) and if the module is
not available immediately call CaptureFromCameraToAssetsFolder using
FindAvailableCamera() (reuse the same camera discovery logic as
CaptureWithCameraFallback), and also change the null-result fallback after
CaptureScreenshotAsTexture to use FindAvailableCamera() before throwing so both
code paths are consistent and robust.
MCPForUnity/Editor/Tools/ManageScene.cs (1)

606-621: Consider extracting the response-building logic to reduce duplication.

The three capture branches (explicit camera, composited, and non-Play-mode fallback) all build nearly identical Dictionary<string, object> payloads with the same keys. This is a minor code smell but acceptable for clarity in this context.

Optional: Extract helper method
private static Dictionary<string, object> BuildScreenshotResponseData(
    ScreenshotCaptureResult result,
    string cameraName,
    bool includeImage)
{
    var data = new Dictionary<string, object>
    {
        { "path", result.AssetsRelativePath },
        { "fullPath", result.FullPath },
        { "superSize", result.SuperSize },
        { "isAsync", false },
        { "camera", cameraName },
        { "captureSource", "game_view" },
    };
    if (includeImage && result.ImageBase64 != null)
    {
        data["imageBase64"] = result.ImageBase64;
        data["imageWidth"] = result.ImageWidth;
        data["imageHeight"] = result.ImageHeight;
    }
    return data;
}

Also applies to: 636-651, 681-696

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@MCPForUnity/Editor/Tools/ManageScene.cs` around lines 606 - 621, Extract the
repeated dictionary construction into a helper method (e.g.,
BuildScreenshotResponseData) that accepts a ScreenshotCaptureResult, a camera
name string, and includeImage bool and returns Dictionary<string, object>;
replace the three duplicated blocks that currently create the payload and pass
that dictionary into SuccessResponse(message, data) (these blocks reference
result, targetCamera.name or other camera name, includeImage and return new
SuccessResponse) to call the helper instead to reduce duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@MCPForUnity/Editor/Tools/ManageScene.cs`:
- Around line 606-621: Extract the repeated dictionary construction into a
helper method (e.g., BuildScreenshotResponseData) that accepts a
ScreenshotCaptureResult, a camera name string, and includeImage bool and returns
Dictionary<string, object>; replace the three duplicated blocks that currently
create the payload and pass that dictionary into SuccessResponse(message, data)
(these blocks reference result, targetCamera.name or other camera name,
includeImage and return new SuccessResponse) to call the helper instead to
reduce duplication.

In `@MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs`:
- Around line 231-298: The method CaptureComposited calls
ScreenCapture.CaptureScreenshotAsTexture directly and only falls back to
Camera.main; update it to first check IsScreenCaptureModuleAvailable (like
CaptureToAssetsFolder) and if the module is not available immediately call
CaptureFromCameraToAssetsFolder using FindAvailableCamera() (reuse the same
camera discovery logic as CaptureWithCameraFallback), and also change the
null-result fallback after CaptureScreenshotAsTexture to use
FindAvailableCamera() before throwing so both code paths are consistent and
robust.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 89930cfb-d9e6-47b3-8798-99b236394ff8

📥 Commits

Reviewing files that changed from the base of the PR and between 38292bd and 0310606.

📒 Files selected for processing (2)
  • MCPForUnity/Editor/Tools/ManageScene.cs
  • MCPForUnity/Runtime/Helpers/ScreenshotUtility.cs

Copy link
Copy Markdown
Author

Addressed the follow-up feedback in 369695c.

Changes:

  • CaptureComposited now checks IsScreenCaptureModuleAvailable up front and uses FindAvailableCamera() consistently for fallback behavior.
  • Extracted the repeated screenshot response payload construction into BuildScreenshotResponseData(...) in ManageScene.

Validation:

  • Recompiled the Unity test project in batchmode with no compiler errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

game_view screenshots with include_image miss UI Toolkit overlays

1 participant