Hello. There is a task to make a button with a picture and so that when you hover over this button the picture changes.
Only one solution came to mind:
Created a button
Created a picture (Image) as a child object in Button
When you hover the button hung an event.
And the whole problem is to change the sprite of the child object. Trying to change the sprite as follows:
if (this.transform.Find ("Image")) { Debug.Log ("OnHover"); Image bImg = this.GetComponent<Image>(); bImg.sprite = ButtonImageHover; } But for some reason, the sprite does not change, although "OnHover" runs through the console when you hover over the button ...
