- private UIButton button;
- void Start(){
- button = transform.Find("BanButton").GetComponent<UIButton>();
- }
- void DisableBanButton() {
- button.GetComponent<BoxCollider>().enabled = false;//BoxCollider禁用
- button.disabledSprite = "禁用状态图片";//禁用状态图片
- button.isEnabled = false;//不可用
- banButton.state = UIButton.State.Disabled;//禁用状态
- }
Unity3d NGUI UIButton的状态改变
最新推荐文章于 2024-12-26 14:22:18 发布