1
我正在尝试在我的网站上更改Unity3D游戏的播放器元素大小。问题是,在HTML文档本身,这是我从中得到的。Unity3D播放器大小变化?
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
<!--
var unityObjectUrl = "http://webplayer.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 u = new UnityObject2();
u.observeProgress(function (progress) {
var $missingScreen = jQuery(progress.targetEl).find(".missing");
switch(progress.pluginStatus) {
case "unsupported":
showUnsupported();
break;
case "broken":
alert("You will need to restart your browser after installation.");
break;
case "missing":
$missingScreen.find("a").click(function (e) {
e.stopPropagation();
e.preventDefault();
u.installPlugin();
return false;
});
$missingScreen.show();
break;
case "installed":
$missingScreen.remove();
break;
case "first":
break;
}
});
jQuery(function(){
u.initPlugin(jQuery("#unityPlayer")[0], "Tug the Table.unity3d");
});
</script>
<title>Tug the Table - TGH</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="style.css">
<!-- This Template is a WiP - Please report any bugs to the administrative team at The Gaming Hideout. Thank you. All rights reserved. -->
</head>
<body>
<div id="wrap">
<div id="header">
<h1><img src="VexIMG/header.png" alt="The Gaming Hideout" width="760" height="60"></h1>
</div>
<div id="navigation">
<div class="navlinks">
<div id="output2">
</div>
</div>
<script src="nav.js"></script>
</div>
<div id="body">
<div class="game">
<h2>Tug the Table</h2>
<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>
<caption>Tug the Table. Theres really nothing else to it.</caption>
</div>
<div id="footer">
<div id="copyright">
Copyright ? The Gaming Hideout<br>
We own no rights on any game on this site unless otherwise noted.<br>
All Rights Reserved.
</div>
<div id="footnav">
<script src="footnav.js"></script>
</div>
</div>
</div>
它的大小不正确的页面上,所以我尝试浏览代码的方式来改变它的宽度和高度,我什么也没得到。因此,我尝试从浏览器编辑元素代码,然后从元素浏览器中的代码中看到此代码,该代码未显示在HTML中。
<div id="unityPlayer">
<embed src="Tug the Table.unity3d" type="application/vnd.unity" width="100%" height="100%" firstframecallback="UnityObject2.instances[0].firstFrameCallback();" style="display: block; width: 100%; height: 100%;">
</div>
我需要能够编辑我的HTML页面,因此它可以编辑width: 100%
和height: 100%
我自己需要的尺寸。任何想法如何做到这一点?
不,现在让我试试。 – 2014-10-18 16:11:19
很好,谢谢! – 2014-10-18 16:18:20
是的,我发现评论后意识到了一点,所以我删除了它。 – 2014-10-18 16:18:37