mergeInto(LibraryManager.library, { SendMessageToJs: function (message) { if (window.dispatchReactUnityEvent) { var msg = UTF8ToString(message); try { window.dispatchReactUnityEvent("OnWebglMessage", msg); } catch (e) { console.warn("Failed to dispatch event OnWebglMessage " + msg); } } } });