- Home /
Question by
Fireking883 · Apr 25, 2017 at 12:09 AM ·
javascriptbuttonimagebutton trigger events
Changing Button Image On Click (Javascript)
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.() = CubeButton;
Which gives the error: Assets/Inventory.js(96,41): BCE0049: Expression 'self.B1.GetComponent[of 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.
Comment