1. 原始效果 (tip:在4.x的书中有介绍)
2. 打开.html文件原始代码如下
<script type='text/javascript' src='jquery.min.js'></script>
<script type="text/javascript">
<!--
var unityObjectUrl = "UnityObject2.js";
if (document.location.protocol == 'https:')
unityObjectUrl = unityObjectUrl.replace("http://", "https://ssl-");
document.write('<script type="text\/javascript" src="' + unityObjectUrl + '"><\/script>');
-->
</script> <script type="text/javascript">
<!--
var config = {
width: 960,
height: 600,
params: { enableDebugging:"0" } };
var u = new UnityObject2(config); jQuery(function() { var $missingScreen =jQuery("#unityPlayer").find(".missing");
... });
-->
3. 把品红色部分代码替换如下
var config = {
width: ,
height: ,
//params: { enableDebugging:"0" }
params: {
backgroundcolor: "A0A0A0",
bordercolor: "",
textcolor: "FFFFFF",
logoimage: "MyLogo.png",
progressbarimage: "MyProgressBar.png",
progressframeimage: "MyProgressFrame.png"
}
};
config.params["disableContextMenu"] = true;
var u = new UnityObject2(config);
4. 将这3个图片放到.html同一文件夹里
MyLogo.png MyProgressBar.png MyProgressFrame.png
5. 重新进入,或刷新页面会看到效果如下