2011-09-23 29 views
1

工作,我必須在http://toneme.orgHTML Unity插件不維基

維基我想在主頁上運行的統一插件。作爲測試,我有一個簡單的統一項目,它包含一個.html和一個.unity3d二進制文件。這裏是html的內容:

<!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 | thelostcity</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") { 
      unityObject.embedUnity("unityPlayer", "thelostcity.unity3d", 1024, 768); 

     } 
     --> 
     </script> 
     <style type="text/css"> 
     <!-- 
     body { 
      font-family: Helvetica, Verdana, Arial, sans-serif; 
      background-color: white; 
      color: black; 
      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: 1024px; 
     } 
     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: 768px; 
      width: 1024px; 
     } 
     --> 
     </style> 
    </head> 
    <body> 
     <p class="header"><span>Unity Web Player | </span>thelostcity</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">&laquo; created with <a href="http://unity3d.com/unity/" title="Go to unity3d.com">Unity</a> &raquo;</p> 
    </body> 
</html> 
現在

如果我雙擊的.html,谷歌Chrome加載它完美。

,但如果我的二進制文件複製到維基的文件,編輯維基首頁 - >插入HTML控件 - >

<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") { 
         unityObject.embedUnity("unityPlayer", "thelostcity.unity3d", 1024, 768); 

       } 
       --> 
// 
</script> 
<p class="header"><span>Unity Web Player |</span> thelostcity</p> 
<div class="content"> 
<div id="unityPlayer"> 
<div class="missing"><a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!" rel="nofollow"><img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63"></img></a></div> 
</div> 
</div> 
<p class="footer">« created with <a href="http://unity3d.com/unity/" title="Go to unity3d.com" rel="nofollow">Unity</a> »</p> 

...拒不執行:

enter image description here

這是怎麼回事?爲什麼它不起作用?

回答

2

這個問題可能是你放置二進制文件的位置。如果二進制文件不在http://toneme.org/thelostcity.unity3d那麼它不會找到它,因此你的錯誤。

+0

這是現貨。維基,當我上傳一個文件,存儲在例如「/file/view/thelostcity.unity3d」,所以我只需要在HTML小部件中用「/file/view/thelostcity.unity3d」替換「thelostcity.unity3d」。謝謝! –

0

作爲後續,this page詳細介紹如何編寫必要的HTML到本地顯示的窗口小部件,主要內容如下:

<html> 

<head> </head> 


<body> 

<script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script> 

<script type="text/javascript"> 
<!-- 

    unityObject.embedUnity(
     "unityPlayer", 
     "CS.unity3d", 
     300, 300 
    ); 
--> 
</script> 

<div id="unityPlayer" /> 
</body> 

</html> 

所以我只需要在我的wiki創建一個小部件以下HTML:

<script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script> 

<script type="text/javascript"> 
<!-- 

    unityObject.embedUnity(
     "unityPlayer", 
     "/file/view/CS.unity3d", 
     300, 300 
    ); 
--> 
</script> 

<div id="unityPlayer" />