I have update an game to Unity 5.6 for build to WebGL, i noticed that the default WebGL template has been modify, now I have an problem, the ‘sendMessage’ function that I use to communicate from the javascript web embed to the game is not defined this work correctly in previous version, I was searching for any change about it on Unity 5.6 but the documentation not have changes, anyone has the same problem?
is this an change of API or an error in this version?
EDIT: just right after the next search try I found the solution, the problem was with the
new unity WebGL embedding API now use instantation:
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/WebGL.json", {onProgress: UnityProgress});
so now for communicate use:
gameInstance.SendMessage("myObject", "myFunction", "foobar");
Hope this help someone with this problem.