Exactly what the title says. I have tried looking it up but nothing seems to work. The last thing I tried was:
if(BID == 1){
B1.GetComponent.<Image>() = CubeButton;
Which gives the error: Assets/Inventory.js(96,41): BCE0049: Expression ‘self.B1.GetComponentof UnityEngine.UI.Image’ cannot be assigned to.
I am just trying to change the button image to an image of a cube when I click on it.