Easiest, simplest, quickest way of writing to a file in Unity


File.WriteAllText( Path.Combine( Application.dataPath, "file.txt"), "This file has one line.");

The file will be saved under the Assets/ folder when the project is ran in the editor.
When you do this on a standalone build, it will appear on under the build data folder.

Leave a Reply

Your email address will not be published. Required fields are marked *