Skip to content

Commit

Permalink
[DX-3465] feat: new game bridge callback function for unity windows (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 authored Dec 2, 2024
1 parent 272544b commit 141ab88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/game-bridge/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ declare global {
ue: any;
// eslint-disable-next-line @typescript-eslint/naming-convention
Unity: any;
uwb: any;
}
}

Expand Down Expand Up @@ -136,8 +137,10 @@ const callbackToGame = (data: CallbackData) => {
blu_event('sendtogame', message);
} else if (typeof UnityPostMessage !== 'undefined') {
UnityPostMessage(message);
} else if (window.Unity !== 'undefined') {
} else if (typeof window.Unity !== 'undefined') {
window.Unity.call(message);
} else if (typeof window.uwb !== 'undefined') {
window.uwb.ExecuteJsMethod('callback', message);
} else {
const gameBridgeError = 'No available game callbacks to call from ImmutableSDK game-bridge';
console.error(gameBridgeError);
Expand Down

0 comments on commit 141ab88

Please sign in to comment.