- 最后登录
- 2014-10-23
- 注册时间
- 2011-7-19
- 阅读权限
- 90
- 积分
- 81303
- 纳金币
- -1
- 精华
- 11
|
Menu复制内容到剪贴板代码:
var showMenuButton:ShowMenuButton;
var menuButton:GUITexture;
var menu1:GUITexture;
var menu2:GUITexture;
var menu3:GUITexture;
function OnGUI(){
if(showMenuButton.showMenu){
if(menu1.transform.position.y<menuButton.transform.position.y+0.44){
menu1.transform.position.y+=Time.deltaTime;
}
if(menu1.transform.position.y>0.18&&menu2.transform.position.y<menu1.transform.position.y-0.15){
menu2.transform.position.y+=Time.deltaTime;
}
if(menu2.transform.position.y>0.18&&menu3.transform.position.y<menu2.transform.position.y-0.15){
menu3.transform.position.y+=Time.deltaTime;
}
}
if(!showMenuButton.showMenu){
if(menu1.transform.position.y>menuButton.transform.position.y){
menu1.transform.position.y-=Time.deltaTime;
}else{
menu1.transform.position.y=menuButton.transform.position.y;
}
if(menu2.transform.position.y>menuButton.transform.position.y){
menu2.transform.position.y-=Time.deltaTime;
}else{
menu2.transform.position.y=menuButton.transform.position.y;
}
if(menu3.transform.position.y>menuButton.transform.position.y){
menu3.transform.position.y-=Time.deltaTime;
}else{
menu3.transform.position.y=menuButton.transform.position.y;
}
}
} ShowMenuButton复制内容到剪贴板代码:
var showMenu : boolean = false;
function OnMouseEnter () {
gameObject.GetComponent(GUITexture).color = Color.red;
showMenu = ***e;
}
function OnMouseUp () {
showMenu = !showMenu;
if(showMenu)
gameObject.GetComponent(GUITexture).color = Color.red;
else
gameObject.GetComponent(GUITexture).color = Color.yellow;
}
|
|