Scoring, Changing scenes, and randomization?

Hi everyone!

So I have a bit of a problem. First of all, small info: I want players to click on a (correct) picture out of multiple photos. Each time they click the right picture they earn a point and the pictures reshuffle.

Would the best way to do this be by having the game reload the scene each time the correct photo is selected? Or is there a way to click the right photo, add a point to the player’s score, and then randomize/reshufle the board (all within the same scene)?

I know that there is a Random code/script but I have no idea how to use it or randomize the objects in a pattern (such as rows of 5). Also I am confused how to have the pictures re-shuffled after the correct picture is selected.

Would be something like (forgive the bluntnes)

If: Correct photo is selected → Add a point and Randomize

Else: Lose.

(Would I even need an “else” option if it is a do-or-die kind of thing?)

I appreciate all you help so much and you guys have been an great community!

you can do all of that in one scene (unity is not flash btw)

this is an example code of how you could do it (you must not use GUI Textures)

public int score = 0;
public Texture2D[] pictures;
private int[] currentOrder;
private int rightPicture;

public void Reshuffle () {
    rightPicture = Random.Range(0, pictures.Length-1);
    currentOrder = new int[pictures.Length];
    for (int i = 0; i < pictures.Length; i++) {
        currentOrder[i] = Random.Range(0, pictures.Length-1);
    }
}

void OnGUI () {
    for (int i = 0; i < pictures.Length; i++) {
        if (GUI.Button(new Rect(i*100,i*100,100,100), pictures[currentOrder[i]])) {
            if (i == rightPicture) {
                score++;
            } else {
                Debug.Log("Loser!");
                Application.LoadScene(0);
            }
           Reshuffle();
        }
    }
}

Thank you so much! I know enough about coding to understand this so it is a huge help!!!

Just one little question, when you say no GUI Texture, that means that the pictures can’t be GUI textures? Because I already have the pictures made. I just attatch the right scripting to the picture and make it an object (or is it prefab)?

Thanks again!

Im confused.

Haha sorry about that. I am just a bit confused what you mean by “You must not use GUI textures”. Does that mean I shouldn’t use them for that scene specifically? Can I still use them on my main menu scene?

Oh sorry (for my bad english) I wanted you say that you can use them, like i did in the example, but you dont have to. You can also use sprites, or quads, or whatever where you have the pictures as a material on them.