Save number in game

I need to save a number as a variable integer so if I quit the game and get back on the number will be saved. It’s used for missions. Depending on the number that’s saved the missions you can play. So can someone help?

Check out the PlayerPrefs class

What you mean?
you wanna keep a number in your hard disk… and read it when player start the game?

even though i worked on java in unity … i’m not good at it… but in C# … :

StreamReader r1 = File.OpenText(/*AddressOfFile*/);
String[] strLineList1 = new String[100];/* Make string with 100 slot*/
  
//Read From File
try /* may or may not, try function need more process ... using for debug error*/
{
  for (i = 0; i < 100; i++)
  {
    strLineList1[i] = r1.ReadLine(); /*Read file line by line and fill 100 slot of our string... u may just need 1 slot... or simple string*/
  }
}
catch
{
  MessageBox.Show("I/O error while reading file", "I/O Error", MessageBoxButtons.OK, MessageBoxIcon.Error);/* u wont need this, catch come with try function ... u may want to try again to read your file u can use here... or show a message*/
}
r1.Close();/*when u open a file you should close it too*/
                                        //Write To File
try
{
  StreamWriter w2 = File.CreateText(/*File Address*/);
  for (j = 0; j <= 99; j++)
  {
     if (strLineList2[j] != null)/*if there's any thing for write*/
     {
       w2.WriteLine(strLineList2[j]);
     }
}
w2.Close();
}
catch
{
  MessageBox.Show("I/O error while writing file", "I/O Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

////////////////////////
Edit:
////////////////////////
Seem Ntero ways is much better…