Mina Michael Mina Michael - 2 months ago 7x
C# Question

Difference between Button.interactable and Button.IsInteractable()

I have a button and I want to set it's state. I found

. What's the difference? The second one is a "virtual bool" but I don't know what that means.


Button inherits from UI.Selectable and so it implements the method IsInteractable() that is simply a check, whilst Button.interactable enable you to modify the property.

As far as a virtual method is concerned, it means that the method can be redefined in a derived class and that can happen with a new keyword (that redefines the method only for a derived class) or with an override (that can affects also a base class)