[code=javascript]var enable:boolean;
var i = 1;
var id ="";
var info="";
var url="http://www.baidu.com";
//var url="http://localhost/data/getinfo.asp";
var tiptext:GUIText;
var textskin : GUISkin;
function Start () {
// Start a download of the given URL
var www : WWW = new WWW (url+id);
// Wait for download to complete
yield www;
// assign texture
info=www.text;
}
function OnGUI(){
GUI.skin = textskin ;
if (i % 2 ==0){
GUI.Button(Rect (500,10,300,300),info);
}
}
function OnMouseDown(){
//if (Input.GetMouseButton(0)){
i ++;
//}
}
function OnMouseOver () {
transform.Rotate(0, Time.deltaTime*100, 0, Space.World);
//tiptext.transform.position=new Vector3(Input.mousePosition.x/Screen.width,Input.mousePosition.y/Screen.height,0);
// tiptext.text=id;
}
function OnMouseEnter(){
renderer.material.color = Color.blue;
//tiptext.text ="1111";
//tiptext.transform.position=new Vector3(Input.mousePosition.x/Screen.width,Input.mousePosition.x/Screen.height,0);
//tiptext.transform.position=camera.ScreenToWorldPoint(Vector3(Input.mousePosition.x,Input.mousePosition.y,0));
}
function OnMouseExit(){
renderer.material.color = Color.yellow;
}
[/code] |