react-unity-webgl
Advanced tools
Comparing version 6.3.0 to 6.3.1
{ | ||
"name": "react-unity-webgl", | ||
"version": "6.3.0", | ||
"version": "6.3.1", | ||
"description": "A Unity WebGL component for your React application", | ||
@@ -5,0 +5,0 @@ "main": "library/index.js", |
@@ -129,3 +129,3 @@ # React Unity WebGL | ||
``` | ||
Where methodName is the name of a method in your JSLib, this method will be binded to the current browser UnityReactWebGL object so you can refer to it in your JSLib; callback will be a function, which takes one parameter with the value passed by your content. Note that it is recommended to register the callbacks before loading the Unity content. For example: | ||
Where methodName is the name of a method in your JSLib, this method will be binded to the current browser ReactUnityWebGL object so you can refer to it in your JSLib; callback will be a function, which takes one parameter with the value passed by your content. Note that it is recommended to register the callbacks before loading the Unity content. For example: | ||
```js | ||
@@ -144,7 +144,7 @@ import React from 'react' | ||
``` | ||
In order to use the function, you have to create a JSLib file to bind the communication. The listener registered in React is now available in the UnityReactWebGL object in any JSLib file. You can now create a JSLib file and make calls`Assets/Plugins/WebGL/MyPlugin.jslib`. | ||
In order to use the function, you have to create a JSLib file to bind the communication. The listener registered in React is now available in the ReactUnityWebGL object in any JSLib file. You can now create a JSLib file and get started. `Assets/Plugins/WebGL/MyPlugin.jslib`. | ||
```js | ||
mergeInto (LibraryManager.library, { | ||
OpenMenu: function (menuId) { | ||
UnityReactWebGL.OpenMenu (menuId); | ||
ReactUnityWebGL.OpenMenu (menuId); | ||
} | ||
@@ -151,0 +151,0 @@ }); |
923027