react-unity-webgl
Advanced tools
Comparing version 8.6.0 to 8.6.1
{ | ||
"name": "react-unity-webgl", | ||
"version": "8.6.0", | ||
"version": "8.6.1", | ||
"description": "React Unity WebGL provides an easy solution for embedding Unity WebGL builds in your React application, with two-way communication between your React and Unity application with advanced API's.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -67,2 +67,3 @@ <div align="center"> | ||
- [Creating Unity WebGL builds](#creating-unity-webgl-builds) | ||
- [Contribution and Development](#contribution-and-development) | ||
@@ -175,3 +176,3 @@ ## Getting Started | ||
In order to dispatch Event Listeners, a JSLib file has to be created within your Unity Project "Plugins/WebGL" directory. The React Unity WebGL module exposes a global method which allows for the dispatchment of the Event Listeners. When writing your JSLib file, simply invoke the eventName using the global methpd "dispatchReactUnityEvent" with an optional parameter. | ||
In order to dispatch Event Listeners, a JSLib file has to be created within your Unity Project "Plugins/WebGL" directory. The React Unity WebGL module exposes a global method to the window which allows for the dispatchment of the Event Listeners. When writing your JSLib file, simply invoke the eventName using the global methpd "dispatchReactUnityEvent" with an optional parameter. | ||
@@ -230,3 +231,7 @@ ```ts | ||
GameOver: function (userName, score) { | ||
dispatchReactUnityEvent("GameOver", Pointer_stringify(userName), score); | ||
window.dispatchReactUnityEvent( | ||
"GameOver", | ||
Pointer_stringify(userName), | ||
score | ||
); | ||
}, | ||
@@ -1083,9 +1088,12 @@ }); | ||
GameOver: function () { | ||
dispatchReactUnityEvent("GameOver"); | ||
window.UnityEvent("GameOver"); | ||
}, | ||
NextWave: function (waveNumberValue) { | ||
dispatchReactUnityEvent("NextWave", waveNumberValue); | ||
window.dispatchReactUnityEvent("NextWave", waveNumberValue); | ||
}, | ||
ShowPopup: function (textStringPointer) { | ||
dispatchReactUnityEvent("ShowPopup", Pointer_stringify(textStringPointer)); | ||
window.dispatchReactUnityEvent( | ||
"ShowPopup", | ||
Pointer_stringify(textStringPointer) | ||
); | ||
}, | ||
@@ -1096,3 +1104,3 @@ SubmitScores: function (scoresFloatArrayPointer, arraySize) { | ||
scores.push(HEAPF32[(scoresFloatArrayPointer >> 2) + i]); | ||
dispatchReactUnityEvent("SubmitScores", scores); | ||
window.dispatchReactUnityEvent("SubmitScores", scores); | ||
}, | ||
@@ -1128,4 +1136,11 @@ }); | ||
# Contribution and Development | ||
<!-- ## Known Issues and Limitations | ||
Active known issues and limitations will be documented here and will be linked to an issue or pull request. These issues include both Unity stand-alone as well as module problems. Once these issues are fixed on either side, they will be removed from the documentation. | ||
- Builds made with Unity 2021.2 throws an error when removing the canvas before invoking Quit on the Unity Instance. Problem occurs within and outside of this module. An error is thrown when the canvas element is removed before invoking the Quit method on the Unity Instance. [#250](https://github.com/jeffreylanters/react-unity-webgl/issues/250) | ||
- Some browsers will in combination with hot-module-reloading or server-side-rendering rescale the canvas's height indefinitely when no width or height is defined. To prevent this from happening provide these dimensions via either the style or className tag. The issues should not occur in production builds. [#233](https://github.com/jeffreylanters/react-unity-webgl/issues/233) --> | ||
## Contribution and Development | ||
When contributing to this repository, please first discuss the change you wish to make via the discussion board with me before making a change. Before commiting, please compile your code using npm run compile and open a pull request. | ||
@@ -1132,0 +1147,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
132382
1172
0