New Ui buttons

I watched the video on the new UI for buttons and i didn’t see how to access it in a script. I have looked at a few solutions, but they seem outdated, in that i couldn’t get them to work.

Button is a component, just define a “Button” variable in a script and drag and drop your scene button into that field on the inspector.

Also, the “Button” class is defined in the UnityEngine.UI namespace, so you need to add that on the "using"s at the top.