zhangjiangtao
zhangjiangtao

Reputation: 371

How to disable the UGUI button component?

I used the

GetComponent<Button>().interactable = false;

to disable the button component, but find the UI gameobject become transparent. And I just want disable the button without changing transparent, just like remove the tick on button component.

Did I use it wrong? Or is there something else to do it?

Upvotes: 0

Views: 931

Answers (1)

David
David

Reputation: 16287

GetComponent<Button>().enabled = false;

Upvotes: 1

Related Questions