-
-
Notifications
You must be signed in to change notification settings - Fork 56
fix: Screenshot Capture #2240
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
base: main
Are you sure you want to change the base?
fix: Screenshot Capture #2240
Changes from 2 commits
7c90568
98a7988
a3a70a4
f204618
8f74147
8f852e0
35a172d
11548fe
91aa77f
113e40e
271ef13
c4c5a96
7e183a1
41d69fc
521298d
8dfd665
e2e83a8
072d2d3
176de44
778e03d
34b03bd
f4ed1fa
38d2738
9015cd5
4e634d1
a9dfcb1
e05a579
26be76b
1cd0c2c
b8fdb41
2e24049
8043f3c
6c9b8c8
c0f38f0
73d3589
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using System; | ||
using System.Collections; | ||
using Sentry.Unity.Integrations; | ||
using UnityEngine; | ||
|
||
|
@@ -112,3 +113,26 @@ private void Awake() | |
DontDestroyOnLoad(gameObject); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// A MonoBehaviour that captures screenshots | ||
/// </summary> | ||
public partial class SentryMonoBehaviour | ||
{ | ||
// Todo: keep track of event ID to not capture double/more than once per frame | ||
|
||
public void CaptureScreenshotForEvent(SentryUnityOptions options, SentryId eventId) | ||
{ | ||
StartCoroutine(CaptureScreenshot(options, eventId)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method returns before the coroutine starts/ends, right? how do we know the screenshot will be taken before the event is created? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
} | ||
|
||
private IEnumerator CaptureScreenshot(SentryUnityOptions options, SentryId eventId) | ||
{ | ||
yield return new WaitForEndOfFrame(); | ||
|
||
SentryScreenshot.Capture(options); | ||
|
||
// Todo: figure out how to capture an event with a screenshot attachment from out here | ||
var sentryEvent = new SentryEvent(eventId: eventId); | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.