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