2017-07-29 86 views
1

我試圖通過按下Unity 3D遊戲中的按鈕來創建一個.txt文件。 它在PC上完美運行,但是當我嘗試使用Android時,沒有任何反應。StreamWriter不適用於Android(Unity3D)

我錯過了什麼?

public void Play(){ 
    TextWriter tw = new StreamWriter("helloWorld.txt", true); 
    tw.WriteLine(System.DateTime.Now); 
    tw.Close(); 
} 

PlayerSettings-> OtherSettings-> WriteAccess to External(SDCard)已經打開。

回答

0

我不知道你在哪裏保存數據...

也許你需要使用Application.persistentDataPath + "MyFile.txt"

相關問題