糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > Unity 按钮(Button)的禁用和禁用与变灰

Unity 按钮(Button)的禁用和禁用与变灰

时间:2023-12-02 03:06:53

相关推荐

Unity 按钮(Button)的禁用和禁用与变灰

一.目的

1.1 想知道:Unity 按钮(Button)的禁用和禁用与变灰

1.2 找到快捷方法

二.操作:完成

2.1 代码

/// <summary>/// 功能:设置按钮是否能点击/// </summary>/// <param name="_btn">按钮对象</param>/// <param name="_bIsCanClick">是否能点击</param>void Set_btn_startStopBle(Button _btn,bool _bIsCanClick){if (_bIsCanClick){_btn.GetComponent<Button>().enabled = true;_btn.GetComponent<Button>().interactable = true;}else{_btn.GetComponent<Button>().enabled = false;_btn.GetComponent<Button>().interactable = false;}}

如果觉得《Unity 按钮(Button)的禁用和禁用与变灰》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。