将做好的unity项目发布成web版本,打开后发现出现的是自定义的unity的loading界面,如果修改成我们自己的的logo图案和加载进度条。
操作步骤:
1.在发布的时候勾选上两项
2.用DW打开html文件,修改一些配置信息
1.如果是3.5版本
<script type="text/javascript"> var params = { logoimage: "logo.png",//logo progressbarimage: "loading.png",//加载条图片 progressframeimage:"loadbg.png"//加载条背景 }; function GetUnity() { if (typeof unityObject != "undefined") { return unityObject.getObjectById("unityPlayer"); } return null; } if (typeof unityObject != "undefined") { unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d",1270, 600, params); } </script>
2.如果是4.0版本
<script type="text/javascript"> <!-- ------------------------------------------------------- var config = { width: 1280, height: 660, params: { enableDebugging:"0" } }; var params = { backgroundcolor: "FFFFFF",//背景色 bordercolor: "ffffff",//边框颜色 textcolor: "ffffff",//文本颜色 logoimage: "unitylogo.png",//logo progressbarimage: "unityprogress.png",//加载条 progressframeimage:"unityprogressframe.png"//加载条移动帧 }; var u = new UnityObject2({ params: params } ); ----------------------------------------------------------------------
3.让浏览器全屏显示
var params={ backgroundcolor:"ffffff",//背景色 bordercolor:"ffffff",//边框颜色 textcolor:"ffffff",//文本颜色 logoimage:"data.png",//logo progressbarimage:"unityprogress.png",//加载条 progressframeimage:"unityprogressframe.png",//加载条 disableContextMenu:true } var u = new UnityObject2({params:params});
body { font-family: Helvetica, Verdana, Arial, sans-serif; background-color: black; color: white; text-align: center; margin:0px; padding:0px; width:100%; height:100%; }
div#unityPlayer { cursor: default; height: 100%; width: 100%; }
效果图:
==================== 迂者 丁小未 CSDN博客专栏=================
MyBlog:http://blog.csdn.net/dingxiaowei2013 MyQQ:1213250243
Unity QQ群:858550 cocos2dx QQ群:280818155
====================== 相互学习,共同进步 ===================
转载请注明出处:http://blog.csdn.net/dingxiaowei2013/article/details/18310035
欢迎关注我的微博:http://weibo.com/u/2590571922
需要工程文件的请留言!