You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building content for the web, you might need to communicate with other elements on React Application. Or you might want to implement functionality using Web APIs which [Unity](https://unity3d.com) does not currently expose by default. In both cases, you need to directly interface with the browser’s JavaScript engine. React Unity WebGL provides an easy library for Unity 5.6 / 2017 or newer with different methods to do this.
Copy file name to clipboardExpand all lines: library/modules/UnityEvent.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ var UnityEvent = exports.UnityEvent = function () {
22
22
_createClass(UnityEvent,[{
23
23
key: 'emit',
24
24
value: functionemit(parameter){
25
-
if(this.canEmit()===true)_Unity.UnityInstance.SendMessage(this.gameObjectName,this.methodName,parameter||'');elseconsole.warn('Wait for Unity to be instantiated before sending an event \''+this.methodName+'\'');
25
+
if(this.canEmit()===true)_Unity.UnityInstance.SendMessage(this.gameObjectName,this.methodName,typeofparameter!=='undefined' ? parameter :'');elseconsole.warn('Wait for Unity to be instantiated before sending an event \''+this.methodName+'\'');
0 commit comments