1踢步、enabled
如果需要將按鈕變灰萌焰,則需要另外處理
//禁用按鈕
this.GetComponent<Button>().enabled = false;
2捧杉、interactable
最近才發(fā)現(xiàn)一個禁用和變灰的按鈕倘核,這一年的代碼我踏馬真是白寫了
//禁用和變灰
this.GetComponent<Button>().interactable = false;
1踢步、enabled
如果需要將按鈕變灰萌焰,則需要另外處理
//禁用按鈕
this.GetComponent<Button>().enabled = false;
2捧杉、interactable
最近才發(fā)現(xiàn)一個禁用和變灰的按鈕倘核,這一年的代碼我踏馬真是白寫了
//禁用和變灰
this.GetComponent<Button>().interactable = false;