function LoadUnityWeb () : void
Description
Loads the new web player data file.
The first level of the loaded .unity3d file will automatically be loaded.
All objects, scripts and static variables from the previous .unity3d file will be unloaded.
You can move information between the two sessions using PlayerPrefs class.
This function is only supported in the web player.
If the object has not finished downloading the unity3d file will not be loaded.
Use isDone or yield to see if the data is available.
function Start () {
var stream =
new WWW ("http://www.unity3d.com/webplayers/Lightning/lightning.unity3d");
yield stream;
stream.LoadUnityWeb();
}
function Start () {
var originalPixelRect = guiTexture.pixelInset;
var stream =
new WWW ("http://www.unity3d.com/webplayers/Lightning/lightning.unity3d");
while (!stream.isDone) {
guiTexture.pixelInset.xMax = originalPixelRect.xMin
+ stream.progress * originalPixelRect.width;
yield;
}
guiTexture.pixelInset.xMax = originalPixelRect.xMax;
stream.LoadUnityWeb();
}