Skip to content

Commit 52aac29

Browse files
feature: add new Unity 2021 loader options
1 parent 0ccbd15 commit 52aac29

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/components/UnityRenderer.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ export const UnityRenderer: VFC<UnityRendererProps> = ({
134134
productVersion: c.productVersion,
135135
memoryUrl: c.memoryUrl,
136136
symbolsUrl: c.symbolsUrl,
137+
matchWebGLToCanvasSize: c.matchWebGLToCanvasSize,
138+
devicePixelRatio: c.devicePixelRatio,
137139
},
138140
(p) => onUnityProgress(p)
139141
);

src/lib/context.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export interface UnityInstanceConfig {
88
companyName?: string;
99
productName?: string;
1010
productVersion?: string;
11+
matchWebGLToCanvasSize?: boolean;
12+
devicePixelRatio?: number;
1113
}
1214

1315
export interface UnityLoaderConfig extends UnityInstanceConfig {

typings/unity.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ declare interface Window {
5454
companyName?: string;
5555
productName?: string;
5656
productVersion?: string;
57+
matchWebGLToCanvasSize?: boolean;
58+
devicePixelRatio?: number;
5759
},
5860
onProgress?: (progress: number) => void
5961
): Promise<UnityInstance>;

0 commit comments

Comments
 (0)