Skip to content

Commit f972dc7

Browse files
authored
feat(Unity): Added is_main_thread to Unity context (#104952)
1 parent 3c77fd4 commit f972dc7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

static/app/components/events/contexts/platformContext/unity.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const MOCK_UNITY_CONTEXT = {
1111
copy_texture_support: 'Basic, Copy3D, DifferentTypes, TextureToRT, RTToTexture',
1212
editor_version: '2022.1.23f1',
1313
install_mode: 'Store',
14+
is_main_thread: true,
1415
rendering_threading_mode: 'LegacyJobified',
1516
target_frame_rate: '-1',
1617
// Extra data is still valid and preserved
@@ -45,6 +46,7 @@ describe('UnityContext', () => {
4546
value: '2022.1.23f1',
4647
},
4748
{key: 'install_mode', subject: 'Install Mode', value: 'Store'},
49+
{key: 'is_main_thread', subject: 'Is Main Thread', value: true},
4850
{
4951
key: 'rendering_threading_mode',
5052
subject: 'Rendering Threading Mode',

static/app/components/events/contexts/platformContext/unity.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ export function getUnityContextData({data}: {data: UnityContext}): KeyValueListD
3030
subject: t('Install Mode'),
3131
value: data.install_mode,
3232
};
33+
case UnityContextKey.IS_MAIN_THREAD:
34+
return {
35+
key: ctxKey,
36+
subject: t('Is Main Thread'),
37+
value: data.is_main_thread,
38+
};
3339
case UnityContextKey.RENDERING_THREADING_MODE:
3440
return {
3541
key: ctxKey,

static/app/types/event.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ export enum UnityContextKey {
528528
COPY_TEXTURE_SUPPORT = 'copy_texture_support',
529529
EDITOR_VERSION = 'editor_version',
530530
INSTALL_MODE = 'install_mode',
531+
IS_MAIN_THREAD = 'is_main_thread',
531532
RENDERING_THREADING_MODE = 'rendering_threading_mode',
532533
TARGET_FRAME_RATE = 'target_frame_rate',
533534
}
@@ -537,6 +538,7 @@ export interface UnityContext {
537538
[UnityContextKey.COPY_TEXTURE_SUPPORT]: string;
538539
[UnityContextKey.EDITOR_VERSION]: string;
539540
[UnityContextKey.INSTALL_MODE]: string;
541+
[UnityContextKey.IS_MAIN_THREAD]: boolean;
540542
[UnityContextKey.RENDERING_THREADING_MODE]: string;
541543
[UnityContextKey.TARGET_FRAME_RATE]: string;
542544
type: 'unity';

0 commit comments

Comments
 (0)