Skip to content

feat(Unity): Editor Facelift #13514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ On platforms that do no support multithreading the ANR detection falls back to r

ANR detection is enabled by default in Sentry, but you can opt-out through the editor window by going to `Tools -> Sentry -> Advanced -> ANR Detection`. You can also set the ANR timeout there.

![ANR Detection](./img/unity-anr.jpg)
![ANR Detection](./img/unity-anr.png)

You can also opt out by disabling the integration.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 21 additions & 2 deletions docs/platforms/unity/enriching-events/screenshots/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,28 @@ This feature is only available for SDKs with a user interface, like the ones for

## Enabling Screenshots

Because screenshots may contain <PlatformLink to="/data-management/sensitive-data/">PII</PlatformLink>, they are an opt-in feature. You can enable screenshots as shown below:
Because screenshots may contain <PlatformLink to="/data-management/sensitive-data/">PII</PlatformLink>, they are an opt-in feature. You can enable screenshots as shown below through **Tools > Sentry**:

<PlatformContent includePath="enriching-events/attach-screenshots" />
![Options Screenshot Configuration](./img/editor-window.png)

Or, like so, if you're [configuring things programatically](/platforms/unity/configuration/options/):

```csharp {tabTitle:ScriptableOptionsConfiguration}
options.AttachScreenshot = true;
```

## Screenshot capture mechanism

Since the Unity SDK internally consists of multiple SDKs, the mechanism with which a screenshot gets captured depends on where the error originates.

- C# errors from within your game will be captured through Unity's built-in [ScreenCapture](https://docs.unity3d.com/ScriptReference/ScreenCapture.html). This means that screenshots only contain things visible within your game. Overlays on top of your game will not be visible.
- Native errors get captured by their respective SDK. If you're using a native plugin to display an overlay and an error occurs then that SDK will try to capture a screenshot that contains the overlay.

<Alert>

Screenshots might contain PII of your app. For example, if your game has a registration form and an error happens while the form is being displayed.

</Alert>

## Viewing Screenshots

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ This feature only applies to SDKs with a user interface, such as the ones for mo

## Enabling View Hierarchy Attachments

View hierarchy debugging is an opt-in feature. You can enable it via the configuration editor `Enrichment -> Attach Hierarchy` or programmatically:
View hierarchy debugging is an opt-in feature. You can enable attaching the view hierarchy as shown below through **Tools > Sentry**:

```csharp
![Options Screenshot Configuration](./img/editor-window.png)

Or, like so, if you're [configuring things programatically](/platforms/unity/configuration/options/):

```csharp {tabTitle:ScriptableOptionsConfiguration}
options.AttachViewHierarchy = true;
```

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
22 changes: 0 additions & 22 deletions platform-includes/enriching-events/attach-screenshots/unity.mdx

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.