Skip to content

Change screenshot method to TakeScreenshotAsync#270

Merged
nowsprinting merged 4 commits intomasterfrom
chore/screenshot_async
Oct 22, 2025
Merged

Change screenshot method to TakeScreenshotAsync#270
nowsprinting merged 4 commits intomasterfrom
chore/screenshot_async

Conversation

@nowsprinting
Copy link
Copy Markdown
Owner

Before

  • Always use ScreenshotHelper.TakeScreenshot method.

After

  • Use ScreenshotHelper.TakeScreenshotAsync method if Unity 2023.1 or newer
  • Mark obsolete SuperSize and StereoCaptureMode in ScreenshotOptions
  • Mark obsolete Gizmos in MonkeyConfig

Copilot AI review requested due to automatic review settings October 22, 2025 17:22
@github-actions github-actions bot added the chore label Oct 22, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the screenshot capture mechanism to use Unity's newer async API when available, while maintaining backward compatibility with older Unity versions.

Key Changes:

  • Migrated from TakeScreenshot to TakeScreenshotAsync for Unity 2023.1+
  • Deprecated obsolete screenshot options (SuperSize, StereoCaptureMode) and Gizmos config property
  • Removed tests for deprecated screenshot features

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Runtime/Monkey.cs Added conditional compilation to use TakeScreenshotAsync for Unity 2023.1+, moved coroutine runner behind version guard
Runtime/OperationLogger.cs Updated to use TakeScreenshotAsync with conditional compilation for Unity 2023.1+
Runtime/ScreenshotOptions.cs Marked SuperSize and StereoCaptureMode properties as obsolete
Runtime/MonkeyConfig.cs Marked Gizmos property as obsolete and improved documentation
Tests/Runtime/MonkeyTest.cs Removed tests for deprecated features, refactored test setup methods to static, cleaned up unused constants
Runtime/Operators/Utils/PointerClickEventSimulator.cs Updated logger parameter documentation
Runtime/Operators/Utils/PointerDragEventSimulator.cs Updated logger parameter documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link
Copy Markdown

Code Metrics Report

master (c9411e1) #270 (6cc5285) +/-
Coverage 85.1% 85.0% -0.1%
Code to Test Ratio 1:1.3 1:1.3 -0.1
Test Execution Time 12m38s 13m26s +48s
Details
  |                     | master (c9411e1) | #270 (6cc5285) |  +/-  |
  |---------------------|------------------|----------------|-------|
- | Coverage            |            85.1% |          85.0% | -0.1% |
  |   Files             |               67 |             67 |     0 |
  |   Lines             |             2260 |           2256 |    -4 |
- |   Covered           |             1924 |           1919 |    -5 |
- | Code to Test Ratio  |            1:1.3 |          1:1.3 |  -0.1 |
  |   Code              |             4143 |           4161 |   +18 |
- |   Test              |             5763 |           5723 |   -40 |
- | Test Execution Time |           12m38s |         13m26s |  +48s |

Code coverage of files in pull request scope (93.6% → 93.3%)

Files Coverage +/- Status
Runtime/Monkey.cs 98.0% -0.1% modified
Runtime/MonkeyConfig.cs 100.0% 0.0% modified
Runtime/Operators/Utils/OperationLogger.cs 100.0% 0.0% modified
Runtime/Operators/Utils/PointerClickEventSimulator.cs 92.8% 0.0% modified
Runtime/Operators/Utils/PointerDragEventSimulator.cs 82.4% 0.0% modified
Runtime/ScreenshotOptions.cs 80.0% -20.0% modified

Reported by octocov

@nowsprinting nowsprinting merged commit 180bd4e into master Oct 22, 2025
15 checks passed
@nowsprinting nowsprinting deleted the chore/screenshot_async branch October 22, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants