I am trying to change the source image on the UI button when i click. Can someone help me with scripting this in JS? I cannot seem to figure it out. Thanks a lot in advance.
This is where I am right now:
#pragma strict
var button : UnityEngine.UI.Button;
var sprite : Sprite;
var newsprite : Sprite;
function Start () {
}
function OnMouseUpAsButton () {
button.GetComponent<Image>()= newsprite;
}