I am having the hardest time trying to get this done.
I have a Text file that is blank, That i want to Read / Write too. however, I want the GUI to be able to read it in a Text area, and Edit the Text file in realtime, or a button that would save the changes to a Text file.
import System.IO;
var contents : String = "Write some text!";
var file : String = "somefile.txt";
function Start()
{
Load();
}
function OnGUI()
{
// Use contents string in text area.
// Have buttons call load and save.
}
function Load()
{
contents = File.ReadAllText(file);
}
function Save()
{
File.WriteAllText(file, contents);
}