I have been struggling to get some old code to work in Unity 5 after upgrading. It seems some major changes have been put in place with I/O and I was wondering how to do this in modern Unity.
In the past I could use this:
System.IO.File.WriteAllText(Application.dataPath + "/" + textName + fileExt, text);
Then I found I could almost use this:
string fileName = "Resources/mytext.txt";
StreamWriter stream = File.CreateText(fileName);
stream.WriteLine(SaveString);
stream.Close();
But I can't seem to get any write functions to work anymore. I'm using Unity 5.3.2p2 if that helps.
I'm getting errors that these write methods no longer work. What is used instead?
↧