Referencing text files in Unity?

How can I create read a .txt file in Unity? For example, if I wanted to save my level in .txt form, how could I do this?

If you are just looking to store your level info, take a look at using a Text Asset. Here

I’m doing this in my current project and its working out great. I created a simple level definition class and read the text file in at start up. I’m using my own format and parser, but you can use .Txt, HTML, XML, and even binaries. Just put your file in a folder called ‘Resources’ and you can use ‘Resources.Load’ or created a public var in a script and reference it directly from the inspector.

Use the C# file I/O.