- Home /
Question by
Astha_Mishra · Jan 03, 2018 at 02:39 PM ·
unity 5uigameobjectspritesspriterenderer
how can i get the clicked sprite which is placed on UI canvas?
i want to access the various sprites present on the UI canvas using a single variable ... Like on which sprite i click that sprite can be access by using the single variable.
Comment
Answer by OneCept-Games · Jan 03, 2018 at 02:48 PM
Use a UI Button object and assign your graphics to the Image component of the button object. Then use OnClick event and call a method in a script you have on your controller object (ie. MenuManager).