-3

i am creating a game in unity, its having a problem that it reset the value of a var whenever i reopen it. so,how to assign a value inside an if statement and store its value forever even if you restart the program in C#?

ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
Yash Verma
  • 48
  • 2
  • 7

1 Answers1

-1

you could store the value in a database and open that database whenever you want to view or change that value. So, it would be unaffected even if you restart your program or application.check this to save to a Microsoft SQL server

  • 1
    Not advised with Unity you can simply use ```PlayerPrefs``` to save data over multiple runs no external database needed. – IndieGameDev Jun 24 '21 at 07:18