On my UI I have an image which has to be updated as soon as I press a certain key (e.g. the heart image is changed to a coin image). In this case I just want to try to call the method by using
I don’t want to press a button on the UI. Now I want to switch between to images but I don’t know how I can reference between the two images. I saw solutions like these:
currentImage.sprite = newImage;
My sprites are not really images but I don’t want to create images out of them. Do I have to do it or can I do it with the sprites? And what other solutions are there?