var gui : GUITexture;
var find : GUITexture;
//var GameObjectName;
function Awake(){
find=GameObject.Find("guiTexture").GetComponent(GUITexture);
find.enabled=false;
}
function OnMouseDown()
{
//find=GameObject.Find("guiTexture").GetComponent(GUITexture);
find.enabled=***e;
Debug.Log(gameObject.name);
www(gameObject.name);
}
function www(Cubename){
// Store the original pixel inset
// and modify it from there.
var originalPixelRect = gui.pixelInset;
// Update the progress bar by scaling the gui texture
// until we reach the end
var stream=new WWW(""+Cubename+".unity3d");
while (!stream.isDone)
{
gui.pixelInset.xMax = originalPixelRect.xMin
+ stream.progress * originalPixelRect.width;
yield;
}
// Update it one last time before loading
gui.pixelInset.xMax = originalPixelRect.xMax;
stream.LoadUnityWeb();
}
@script RequireComponent (GUITexture)