Mina Michael Mina Michael - 1 year ago 159
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.

Answer Source

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)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download