var show = false;

var grow = false;

var min = 0.0;

var max = 50.0;

var height = 0.0;

var speed = 0.0;

//var skin:GUISkin;

function OnGUI ()

{

//GUI.skin = skin;

if(GUI.Button(Rect(5,5,104,25),”List”))

{

grow = true;

if(!show)

show = true;

}

if(show)

{

GUILayout.BeginArea(Rect(7,30,100,height),”",”Box”);

GUILayout.BeginVertical();

for(i = 0;i<18;i++)

GUILayout.Button(i+”.Title”);

GUILayout.EndVertical();

GUILayout.EndArea();

}

if(grow)

{

speed += Time.deltaTime*5.0;

height = Mathf.Lerp(min,max,speed);

if(Mathf.Approximately(height,max))

{

grow = false;

max = min;

min = height;

speed = 0.0;

if(min == 0)

show = false;

}

}

}

本文转自:http://www.comedreams.com/index.php/archives/10249

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-11-02
  • 2022-12-23
  • 2021-09-22
猜你喜欢
  • 2021-03-31
  • 2021-06-06
  • 2021-06-26
  • 2021-06-11
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案