如何隐藏统一按钮

如何隐藏统一按钮

I agree with "Happy Apple's" solution, and just to expand on this if you wanted to integrate reverse functionality you can simply alter the code as follows:var isButtonVisible : boolean = true;var buttonRectangle : Rect = Rect(100, 100, 100, 50);function OnGUI (){if(isButtonVisible){ if(GUI.Button(Rect(Screen.width/2 - 75,Screen.height/2 - 25,150,50),"button")) { isButtonVisible = false; }}else{ if(GUI.Button(Rect(Screen.width/2 - 75,Screen.height/2 -25,150,50),"this is also a button")) { isButtonVisible = true; }}}希望这会有所帮助. 这篇关于如何隐藏统一按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-26 06:36