lundi 3 septembre 2018

Unity C# Cycling some texts without repeating them

That's my first post (long time visiting stackoverflow and reading Q&A).

I've a line in the bottom part of the main screen of the game, that every time the scene is loaded, it shows a different tip (how to play, how to change music...).

The question is that I'm using Random.Range for that but, honestly, I'll prefer a way where all tips are showed, one by one in a random way, but without repeating any of them.

My code is as follows:

int randNum;
void Start () {
    randNum = Random.Range(0,5);
}

void Update () {

    switch (randNum)
    {
        case 0:
       // blah, blah, blah...
        case 1...

How can I achieve what I want?

Thans for yout timeeee :)




Aucun commentaire:

Enregistrer un commentaire