- Home /
Changing GUI Button Script
I am trying to make a UI image a button for an ios game. I added the button script to it, which I wanted to edit with the edit script function. That method does not work for me, and does not open monodevelop. Does anyone know what is happening and how to fix it, or an alternative way to make an image a button for mobile touch input? Thanks for the help.
Answer by SirAstral · Jul 20, 2015 at 05:01 PM
I would recommend that you add the button first and then add your image to the button for appearances. Additionally, I do not thin it is normally possible or even a good idea to try to edit the button script.
Just add an additional script of your own if you want to alter button behavior or to make it perform actions.
It have created tons of buttons for an app I am currently building and have found just creating your buttons first then modifying looks after is much more effective.
Answer by Cherno · Jul 20, 2015 at 05:03 PM
The component type Button does not inherit from MonoBehaviour and thus can't be edited like MB scripts. You can accecss it's functions and variables either via script or via the inspector. I see that you have collapsed the button component; Click on the grey arrow pointing to the right on the left side, next to the checkbox, and expand the component.
Answer by SamOf2 · Jul 20, 2015 at 05:27 PM
why don't you just do canvas - ui - button and on the image for that button select moleimage_test?
Answer by $$anonymous$$ · Nov 15, 2018 at 06:21 PM
Does anyone know how to access the Button Script though? and surely if there's an 'Edit Script' button it should be possible to view the script of that component