纳金网
标题:
GUI菜单弹出隐藏效果
[打印本页]
作者:
会飞的鱼
时间:
2012-7-2 15:26
标题:
GUI菜单弹出隐藏效果
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;
}
作者:
nts
时间:
2013-10-18 18:58
学习了谢谢
作者:
幸福小猪
时间:
2013-10-28 11:04
感谢楼主分享
欢迎光临 纳金网 (http://old.narkii.com/club/)
Powered by Discuz! X2.5