Unity按钮的禁用

怎么让程序运行到某一步时,让某一button键失效或隐藏。
方法1:
类同如VB中命令:
Command1.Enabled = False 按钮命令失效
Command1.Visible = False 按钮命令隐藏

方法2:

//禁用

this.GetComponent<Button>().enabled= false;

//禁用与变灰

this.GetComponent<Button>().interactable = false;


多谢指教!

猜你喜欢

转载自blog.csdn.net/Uu_hua/article/details/122418538