Ok, so I don't have the game and I have no idea what it looks like, but I had no problems installing it in SilverStripe anyway :-)
On a clean install, with no other javascript files loaded, in your Page_Controller:
function init() {
parent::init();
Requirements::javascript('http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js');
Requirements::customScript(<<<JS
//gets the unityPlayer div and replaces the content with an embed tag which is the web player made by Unity (it works outside of SS.)
function GetUnity() {
if (typeof unityObject != "undefined") {
return unityObject.getObjectById("unityPlayer");
}
return null;
}
//sets the parameters of the web player
if (typeof unityObject != "undefined") {
unityObject.embedUnity("unityPlayer", "MazePuzzle.unity3d", 720, 450);
}
JS
);
}
(make sure there's no whitespace before the closing 'JS' !!!)
in your template somewhere:
<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>
Do a ?flush=1
Now in my html (firebug) I see the div tag replaced:
<div style="width: 720px; height: 450px; visibility: visible;" id="unityPlayer"><embed src="MazePuzzle.unity3d" firstframecallback="unityObject.firstFrameCallback();" style="display: block; width: 100%; height: 100%;" type="application/vnd.unity" width="720" height="450"></div>
One more tip: make sure your html validates - maybe some forgotten closing </div> might cause the problem...