Do I need all the buttons on stage to do a GameObject?

Learn Unity, there arose a question - I want to make a button with a picture of the sprite. How best to do it - just make a sprite on a canvas or draw on an empty canvas object and in its properties add the image? What is the fundamental difference? And if the object does not need to create, why?
June 8th 19 at 16:47
2 answers
June 8th 19 at 16:49
When you take out the sprite on the stage, the object is created with the component SpriteRenderer, you can drag and drop it on the canvas or not, doesn't matter. SpriteRenderer inside the ui is not used, there is a component Image. If you want to turn this picture into a button, you can use the Button. What specific path you choose to create buttons does not affect the result, the only risk is that you forget to add a component, and the button just won't work. If not yet fully understand how the ui works, I advise you to use a submenu Create > UI
June 8th 19 at 16:51
Why not just use the UI.Button ?
I have never seen in the lessons in order for the custom buttons (the ones in the pictures) used by the UI.Button? It is better to use? - Benjamin.Keebler commented on June 8th 19 at 16:54
Or if you so much want to implement the button using the normal Image. Have monobike that it will cling to implement interfaces IPointerClick, IPointerDown, IPointerUp. The last two need for that would enable reactions button. - tomas_Upt commented on June 8th 19 at 16:57
and what is the most common practice, as in the games yuniti make a nice menu with buttons??? - Benjamin.Keebler commented on June 8th 19 at 17:00
Immediately draw button and then typeset. If there is a question in animating buttons that is a bunch of instruments, ranging from all sorts of twinprov ending with the unity Animator. - tomas_Upt commented on June 8th 19 at 17:03

Find more questions by tags Unity Game Engine