-

유니티 입출력하는 방법 ( 파일 쓰기) 본문

프로그래밍(Programming)/유니티 Unity

유니티 입출력하는 방법 ( 파일 쓰기)

-_-? 2016. 7. 25. 17:36

c#

WriteFile("test.txt");

void WriteFile(string filepathIncludingFileName)

{

StreamWriter sw = new StreamWriter( filepathIncludingFileName );

sw.WriteLine("Line to write"); // 줄단위로 파일에 입력

sw.WriteLine("Another Line");

sw.Flush(); // 파일 쓰기 반드시 해준다.

sw.Close(); // 파일 쓰기 반드시 해준다.

}

Comments