Ok so is there any way by which i can save a variable, such as score, points, etc. in a .txt file? which i can load later in the game…?
i know we can use playerprefs.SetInt() and PlayerPrefs.GetInt() to save a variable very easily but i am curious if we could save it into a .txt or any other file format? using the unity I/O?
let the variable be…
var MyScore : int = 10;
Watch this video: PERSISTENCE - SAVING AND LOADING DATA
It nicely describes many aspects of how to read and write to files.
Also you can use any file extension as you like let it be .txt, or .dat, or .blablablabla.
Specifically for text file read this: How do I write a line of text to a file?
Now you can do research further on how to read similarly.