From e33c0b081ce99399f52b58563af8e7ee75e2a2e0 Mon Sep 17 00:00:00 2001 From: Talha Momin <77355191+momintlh@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:02:17 +0500 Subject: [PATCH] Fixed insertCoin Callbacks --- Assets/Plugins/PlayroomPlugin.jslib | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Assets/Plugins/PlayroomPlugin.jslib b/Assets/Plugins/PlayroomPlugin.jslib index 073fb30..26e2ad0 100644 --- a/Assets/Plugins/PlayroomPlugin.jslib +++ b/Assets/Plugins/PlayroomPlugin.jslib @@ -23,6 +23,16 @@ mergeInto(LibraryManager.library, { }); } + function OnLaunchCallBack() { + dynCall("v", onLaunchCallBack, []); + } + + function OnDisconnectCallback() { + dynCall("v", onDisconnectCallback, []); + } + + + var options = optionsJson ? JSON.parse(UTF8ToString(optionsJson)) : {}; Promise.all([ @@ -40,9 +50,9 @@ mergeInto(LibraryManager.library, { return; } - Playroom.insertCoin(options) + Playroom.insertCoin(options, OnLaunchCallBack, OnDisconnectCallback) .then(() => { - dynCall("v", onLaunchCallBack, []); + Playroom.onPlayerJoin((player) => { var id = player.id;