unity打包网页工程自适应全屏。
getServiceHearder() 方法是网页向Unity发消息。参数是物体名、方法名、参数。
<html> <head> <title>Itaki标题栏</title> <style>body{ margin:0; height:100%} html{ height:100%}</style> <script> var emid = "UnityEmbed"; if (!!window.ActiveXObject || "ActiveXObject" in window){ emid = "UnityObject"; } function getServiceHearder(){ var url = window.location.href.substring(0,4); document.getElementById(emid).SendMessage("jiami","seturl",url); } </script> </head> <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" style="overflow: hidden;"> <object id="UnityObject" classid="clsid:444785F1-DE89-4295-863A-D46C3A781394" width="100%" height="100%" codebase="http://webplayer.unity3d.com/download_webplayer-3.x/UnityWebPlayerFull.exe"> <param name="src" value="yysd.unity3d" /> <param name="disableContextMenu" value="true" /> <embed id="UnityEmbed" src="Unity打包文件名字.unity3d" width="100%" height="100%" type="application/vnd.unity" disableContextMenu="true" pluginspage="http://webplayer.unity3d.com/download_webplayer-3.x/UnityWebPlayerFull.exe"/> </object> </body>
</html>
原文链接:http://blog.csdn.net/sinat_25055335/article/details/50757489
转载于:https://blog.51cto.com/babyfly555/1958937