Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ We also allow you to call JavaScript functions within React from the Unity Conte
```js
RegisterExternalListener (methodName: String, callback: Function): void;
```
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
import React from 'react'
import { RegisterExternalListener } from 'react-unity-webgl'
Expand All @@ -140,11 +140,11 @@ export class App extends React.Component {
}
}
```
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);
}
});
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-unity-webgl",
"version": "6.3.0",
"version": "6.3.1",
"description": "A Unity WebGL component for your React application",
"main": "library/index.js",
"types": "source/types.d.ts",
Expand Down