Skip to content

Commit fc67fc2

Browse files
Documented Debug Symbols
1 parent 4022477 commit fc67fc2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Welcome to the React Unity WebGL Documentation! My name is Jeffrey and I'm here
6969
- [Change the Render Size of WebGL Canvas](#change-the-render-size-of-webgl-canvas)
7070
- [Taking Screenshots of the Canvas](#taking-screenshots-of-the-canvas)
7171
- [Providing an external Memory File](#providing-an-external-memory-file)
72+
- [Providing Debugging Symbols](#providing-debugging-symbols)
7273
- [JavaScript to UnityScript types](#javascript-to-unityscript-types)
7374
- [Creating Unity WebGL builds](#creating-unity-webgl-builds)
7475
- [Contribution and Development](#contribution-and-development)
@@ -1118,6 +1119,41 @@ function App() {
11181119
}
11191120
```
11201121

1122+
## Providing Debugging Symbols
1123+
1124+
> Available since version 8.8.0
1125+
1126+
This is set to the filename of the JSON file containing debug symbols when the current build is using debug symbols, otherwise it is set to an empty string. If the Debug Symbols option is enabled and the Development Build option is disabled then the Debug Symbols will be generated automatically.
1127+
1128+
```tsx
1129+
<IUnityConfig>{
1130+
symbolsUrl: string,
1131+
};
1132+
```
1133+
1134+
#### Example implementation
1135+
1136+
A basic implementation could look something like this. In the following example we'll set the streaming assets url to the "streamingassets" directory.
1137+
1138+
```jsx
1139+
// File: App.jsx
1140+
1141+
import React from "react";
1142+
import Unity, { UnityContext } from "react-unity-webgl";
1143+
1144+
const unityContext = new UnityContext({
1145+
loaderUrl: "build/myunityapp.loader.js",
1146+
dataUrl: "build/myunityapp.data",
1147+
frameworkUrl: "build/myunityapp.framework.js",
1148+
codeUrl: "build/myunityapp.wasm",
1149+
symbolsUrl: "build/debug-symbols.json",
1150+
});
1151+
1152+
function App() {
1153+
return <Unity unityContext={unityContext} />;
1154+
}
1155+
```
1156+
11211157
## JavaScript to UnityScript types
11221158
11231159
Simple numeric types can be passed to JavaScript in function parameters without requiring any conversion. Other data types will be passed as a pointer in the emscripten heap (which is really just a big array in JavaScript). For strings, you can use the Pointerstringify helper function to convert to a JavaScript string.

0 commit comments

Comments
 (0)