Install dependencies for the workspace
yarn install
All commands below need to be run in the context of the game-bridge
package where this README is located. Read more about context here.
Building the Game Bridge for Unity and Unreal:
yarn build
Note: The above build will bundle the index files in the following locations (relative to this README):
- Unity:
./dist/unity/index.html
- Unreal:
./dist/unreal/index.js
,./dist/unreal/index.js.map
During the build step for game-gridge, placeholder SDK version strings are replaced with the actual SDK version strings. To ensure the correct version strings are packaged, as opposed to the local commit hash, which could be different than the latest release tag, the following process should be followed:
-
Make/push changes to game bridge
-
Merge to
main
-
Release new version of the SDK (using the
Publish to NPM
workflow)- This creates a new GitHub tag / release
-
Fetch tags and pull latest changes locally after release workflow completes:
git pull origin main
git fetch --tags
-
Switch to the latest tag that was released:
git checkout tags/<tag-name>
-
Manually build game bridge with steps above
-
Copy the built files to the correct location in the Game SDKs
Game bridge should now have the correct latest version when packaged into the Game SDKs.
Linting:
yarn lint
The Game Bridge package enables interaction between the Typescript SDK and Unity and Unreal SDKs. It does this by wrapping around the required SDK packages and generating an (index.js & index.js.map)/index.html file that can be imported into the Unreal and Unity SDKs, respectively.