Unity与ChinaCache合作:CDN加速插件下载
GameLook报道 / 为了让中国用户以最快的速度下载并使用Unity Web Player插件,从而运行使用Unity引擎开发的网页游戏和应用,Unity公司已经与中国的CDN网络提供商ChinaCache达成了深度的合作协议,允许中国用户通过ChinaCache来下载Unity Web Player的插件、播放器以及升级包。以下是具体的使用方法。为了确保中国用户从ChinaCache下载相关资源,网页游戏开发商需要自行修改自己的html文件,对于使用Unity3.x编辑器发布的html文件,请使其包含以下内容:<script type=”text/javascript” src=”http://wp-china.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 params = {autoupdateURL : “http://wp-china.unity3d.com/autodownload_webplugin-3.x”,autoupdateURLSignature : “02a5f78b3066d7d31fb063186a2eec36fdf1205d49c6b0808eb37ef85ed9902e2e1904d87f599238a802ba0abbfe4f18aa82dd2eb5171e99ba839a5cea9e6ea9c1be9eae505937b56fe4a5fd254cffe08958d961f42d970136b5eab9e6c2cd08b81bc8a11e5ade57dc63dcfef2248d89689e4d4feed3cdfe7374c848fd57ebd4″};unityObject.setBaseDownloadUrl(“http://wp-china.unity3d.com/download_webplayer-3.x/”);unityObject.embedUnity(“unityPlayer”, “WebPlayer.unity3d”, 600, 450, params);}–></script><body>…<a href=”http://unity3d.com/webplayer/” title=”Unity Web Player. Install now!”><img alt=”Unity Web Player. Install now!” src=”http://wp-china.unity3d.com/installation/getunity.png” width=”193″ height=”63″ /></a>…</body>在以上脚本中,特别需要强调的是从wp-china.unity3d.com中下载的UnityObject.js文件,该文件需要传入autoupdateURL/autoupdateURLSignature两个参数;同时还需设置好基础的下载地址(setBaseDownloadUrl),从而保证UnityObject中用到的任何文件(例如图像文件)也都会从wp-china.unity3d.com进行下载。同时,embedUnity函数中需要传入params参数。在body中,getunity.png的下载地址也需要更改为ChinaCache地址。另外,对于使用Unity4.x编辑器发布的html文件,请使其包含以下内容:<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″><title>Unity Web Player | DNSPoison</title><script type=’text/javascript’ src=‘http://wp-china.unity3d.com/unity/jquery.min.js’></script><script type=”text/javascript”><!–var unityObjectUrl = “http://wp-china.unity3d.com/download_webplayer-3.x/3.0/uo/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″,baseDownloadUrl: “http://wp-china.unity3d.com/download_webplayer-3.x/”,autoupdateURL : “http://wp-china.unity3d.com/autodownload_webplugin-3.x”,autoupdateURLSignature : “02a5f78b3066d7d31fb063186a2eec36fdf1205d49c6b0808eb37ef85ed9902e2e1904d87f599238a802ba0abbfe4f18aa82dd2eb5171e99ba839a5cea9e6ea9c1be9eae505937b56fe4a5fd254cffe08958d961f42d970136b5eab9e6c2cd08b81bc8a11e5ade57dc63dcfef2248d89689e4d4feed3cdfe7374c848fd57ebd4”}};…<body>…<div><a href=”http://unity3d.com/webplayer/” title=”Unity Web Player. Install now!”><img alt=”Unity Web Player. Install now!” src=”http://wp-china.unity3d.com/installation/getunity.png” width=”193″ height=”63″ /></a></div><div><a href=”http://unity3d.com/webplayer/” title=”Unity Web Player. Install now! Restart your browser after install.”><img alt=”Unity Web Player. Install now! Restart your browser after install.” src=”http://wp-china.unity3d.com/installation/getunityrestart.png” width=”193″ height=”63″ /></a></div>…</body>在以上脚本中,特别需要强调的是从wp-china.unity3d.com中下载的UnityObject2.js文件,在params中需要加入baseDownloadUrl、autoupdateURL和autoupdateURLSignature三个参数;从而保证UnityObject中用到的任何文件(例如图像文件)也都会从wp-china.unity3d.com进行下载。同时,为了使中国用户可以更快更方便地下载jquery.min.js文件,我们也在ChinaCache上备份了该文件。在body中,getunity.png和getunityrestart.png的下载地址也需要更改为ChinaCache地址。
什么意思啊 是不是以后不用特意下载插件就可以玩unity页游了啊
我很懒,只想回复看看,另感谢楼主分享{:soso__16915934313317769624_2:} 楼主是超人 好帖就是要顶 顶顶多好 说的非常好 很好哦 好帖就是要顶 难得一见的好帖
页:
[1]