Texture2D

#pragma strict
 var  No:int; //在编辑器中,把每个物体上的No号设置为不同. 0,1,2......
 var chineseSkin : GUISkin;//在此可以选择字体,并设置为中文。建议编辑器设为uft-8。
 var buildingname:String;//用来接收从网页中传递过来的buildingname值
 var buildingcategory:String;//用来接收从网页中传递过来的buildingcategory值
 
 var buildingpic:Texture2D;//用来接收从网页中传递过来的buildingpic值
 var windowRect0 = Rect (20, 20, 250, 200);
 var enable:boolean;
 function Awake(){
 enable = false ;
 }
 //鼠标事件
 function OnMouseEnter () 
{    
renderer.material.color = Color.red;
}
 function OnMouseDown () {
enable = true;
 }
 
 function OnMouseExit ()
{   
renderer.material.color = Color.white;
}
//鼠标事件
function OnGUI(){
 GUI.skin=chineseSkin;
 if(enable)
 {
 windowRect0 = GUI.Window (No, windowRect0, DoMyWindow, "项目简介");


 }
 }
 function DoMyWindow (windowID : int) {
 GUI.Label(Rect(10,50,80,30),"名称");
 //GUI.TextField(Rect(100,50,100,30),buildingname);
 GUI.Label(Rect(10,100,80,30),"类型");
 //GUI.TextField(Rect(100,100,100,30),buildingcategory);
 
 GUI.DrawTexture(Rect(10,140,200,50),buildingpic,ScaleMode.ScaleToFit,true,0);
 if(GUI.Button(Rect(190,20,50,30),"退出")){
 enable = false;
 }
 GUI.DragWindow (Rect (0,0,10000,10000));
 } 

你可能感兴趣的:(Texture2D)