Hi there - I'm trying to convert a game from the webplayer to webGL.
I read that the preferred way of talking with the browser is through plugins, so here's my plugin code:
var BrowserInfoPlugin = {
GetBrowserInfo: function()
{
var u = UnityObject2.instances[0];
var ua = u.getPlatformInfo();
ua.screenWidth = screen.width;
ua.screenHeight = screen.height;
return JSON.stringify(ua);
}
};
mergeInto(LibraryManager.library, BrowserInfoPlugin);
I'm getting an error in the built WebGL player that UnityObject2 is not defined. I can't find any information on how to fix this in a plugin...what should the course of action be here? Am I overcomplicating this and the information can be grabbed in Unity / C# directly instead perhaps?
Thanks
↧