Hello there!
I’m new in Unity and trying to create simple clicker which will change images due to the number of clicks.
I have created clicker script but I can’t understand how to change the image after several clicks.
Please see my code, it’s pretty simple but it estimate the clicks:
using UnityEngine;
using UnityEngine.UI;
public class Game : MonoBehaviour
{
public Text scoreText;
private int score;
public void OnClick()
{
score++;
scoreText.text = score + "$";
}
}
I have created Resources directory and uploaded images inside. All the attempts to create such a logic was unsuccessful.
Now I need to figure out how to create new logic for changing images, here are the questions:
- Do I need to create new script to change images or this logic should be created in the current script?
- Do you have any examples of such logic?
- Is there any manuals which you would recommend me to read? It’s my first day in Unity and at the moment all the tools was googled, I have no experience
Thank you in advance, may the force be with you, stay calm, beatuful and smell good.