UnityObject

Description
This wraps all of UT's browser detection and communication in one javascript file and allows you to use minimal code to embed .unityweb's in your web pages.

The code is based on the examples UT has given in the manual and the work Geoff Stearns has done with SWFObject

Now Unity Developers can embed in style & comfort ;)

Tested in Safari 2.0.4, FireFox 2.0.0.2 and Opera 9.01

Compatible with CookieCutter

Usage
All it takes to embed is the following;   var uniObj = new UnityObject("example.unity3d", "example", "640", "480", "000000", "000000"); uniObj.write;

To send a message to unity all you need to do is

To use Pro Features;  var uniObj = new UnityObject("proExample.unity3d", "proExample", "640", "480"); uniObj.addParam("logoimage", "MyLogo.png"); uniObj.addParam("progressbarimage", "MyProgressBar.png"); uniObj.addParam("progressframeimage", "MyProgressFrame.png"); uniObj.write;

If Plugin Not Found Write Alternate HTML;  var uniObj = new UnityObject("example.unity3d", "example", "640", "480"); uniObj.setAttribute("altHTML", "Install the Unity Web Player"); uniObj.write;