function OnWindowDraw(winid:int){
if (GUI.Button(Rect(385,172,42,15),"",styleB)){
windowOpen = false;
}
GUI.Label(Rect(140,12,156,20),tex1,styleLab1);
GUI.Label(Rect(16,6,110,179),icon);
GUI.color=Color.white;
GUI.Label(Rect(140,32,256,70),tex3,styleLab2);
GUI.DragWindow();
}
function OnGUI(){
if(windowOpen){
windowRect = GUI.Window(0,windowRect,OnWindowDraw,"",style);
}
}
function Update() {
//累计时间
timeElasped += Time.deltaTime;
if(timeElasped >= fps) {
timeElasped = 0;
curFrame++;
if(curFrame >= icons.Length) {
curFrame = 0;
}
icon = icons[curFrame];
}
}
运行效果: