Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

UnityObject2 not defined in WebGL jslib plugins?

$
0
0
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

Viewing all articles
Browse latest Browse all 2390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>