L
L
likhan2020-05-06 19:21:52
C++ / C#
likhan, 2020-05-06 19:21:52

unity. Passing data to other scenes?

I'm making a game like "Mental Counting" and the game has a choice of difficulty (Easy, Middle, Hard, Very Hard), and you need to make it so that if he clicks on Easy, then random numbers of the Easy difficulty level are counted in the new scene. And also with the rest of the difficulties. Now I have a question, how to implement this?
PS I forgot to send the code

public class PlayGame : MonoBehaviour
{
        public int difficuality;
    public void Pressefction()
    {
       if(difficuality == 0)
       {
            Debug.Log("Изи");
            SceneManager.LoadScene(2);
        }
       else if(difficuality == 1)
       {
            Debug.Log("Миддле");
        }
       else if (difficuality == 2)
       {
            Debug.Log("Хард");
        }
       else if (difficuality == 3)
       {
            Debug.Log("Вери Хард");
        }
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
egoros7, 2020-05-06
@egoros7

Use global variables like

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question