I am working on a 2D game which will be later used as advertisement activity on a stall, I need to store user information, Name, Number, Email and score. There data may exce
There's a huge problem in Unity that folks see totally wrong example code on the net, and ridiculous problems get propagated for years. Never, ever use "StreamWriter" - just use the trivial File.Write functions. Couldn't be easier.
Regarding the question above: "thousands" of entries is absolutely nothing. (Any irrelevant small icon image in your app will totally dwarf the size of your name/address data.)
(1) you can just save a text file(s),
It's incredibly easy to write and read files in Unity.
// IO crib sheet..
// filePath = Application.persistentDataPath+"/"+fileName;
// check if file exists System.IO.File.Exists(f)
// write to file File.WriteAllText(f,t)
// delete the file if needed File.Delete(f)
// read from a file File.ReadAllText(f)
that's all there is to it.
string currentText = File.ReadAllText(filePath);
NOTE WELL...........
// filePath = Application.persistentDataPath+"/"+fileName;
// YOU MUST USE "Application.persistentDataPath"
// YOU CANNOT USE ANYTHING ELSE
// NOTHING OTHER THAN "Application.persistentDataPath" WORKS
// ALL OTHER OPTIONS FAIL ON ALL PLATFORMS
// YOU CAN >ONLY< USE Application.persistentDataPath IN UNITY
You can store the info in any of may formats such as JSON or csv. Since you have a tiny amount of information, you can trivially just keep the json as a List and access it easily.
Note that if you are unfamiliar with very basic programming tasks like using JSON or csv (all extremely easy) you will need to study that. SO questions/answers cannot be tutorials.
(2) you can learn about using the local SQL database, which is well worth learning. Do what Łukasz Motyczka says in the comments.
(3) it's true that your task is so small you could just use PlayerPrefs. note however this is actually the hardest way! It would be a real mess, trying to use PlayerPrefs as a simple database. So don't do that.
(4) Note that in practice there are no "local apps" these days. To be an "app developer" is to be a cloud developer, likely you will need to use Firebase or the like (Parse having surprisingly closed down this year!)