以下是引用片段:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Unity Web Player | WebPlayer</title> <script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script> <script type="text/javascript"> <!-- function GetUnity() { if (typeof unityObject != "undefined") { return unityObject.getObjectById("unityPlayer"); } return null; } if (typeof unityObject != "undefined") { var myWidth = 0, myHeight = 0, borderSize = 20; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth - borderSize; myHeight = window.innerHeight - borderSize; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth - borderSize; myHeight = document.documentElement.clientHeight - borderSize; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth - borderSize; myHeight = document.body.clientHeight - borderSize; } var params = { backgroundcolor: "000000", bordercolor: "000000", textcolor: "FFFFFF", //logoimage: "MyLogo.png", //progressbarimage: "MyProgressBar.png", //progressframeimage: "MyProgressFrame.png" disableContextMenu: true }; unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", myWidth, myHeight, params); } --> </script> <style type="text/css"> <!-- body { font-family: Helvetica, Verdana, Arial, sans-serif; background-color: black; color: white; text-align: center; } a:link, a:visited { color: #000; } a:active, a:hover { color: #666; } p.header { font-size: small; } p.header span { font-weight: bold; } p.footer { font-size: x-small; } div.content { margin: auto; width: 100%; } div.missing { margin: auto; position: relative; top: 50%; width: 193px; } div.missing a { height: 63px; position: relative; top: -31px; } div.missing img { border-width: 0px; } div#unityPlayer { cursor: default; height: 100%; width: 100%; } --> </style> </head> <body> <!-- <p class="header"><span>Unity Web Player | </span>WebPlayer</p> --> <div class="content"> <div id="unityPlayer"> <div class="missing"> <a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!"> <img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" /> </a> </div> </div> </div> <!-- <p class="footer">« created with <a href="http://unity3d.com/unity/" title="Go to unity3d.com">Unity</a> »</p> --> </body> |
################## 下面为修改代码的主体部分 ####################
var params = {<!--这些是更改加载图标-->
backgroundcolor: "A0A0A0",
bordercolor: "000000",
textcolor: "FFFFFF",
logoimage: "MyLogo.png",
progressbarimage: "MyProgressBar.png",
progressframeimage: "MyProgressFrame.png",
<!--这个是屏蔽右键-->
disableContextMenu: true
};
unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", "100%", "100%", params);