書き込みは、
path を Application.persistentDataPath + "/" + outputTextData;
にする必要があるので、
void WriteFile(string txt){}
部分を
以下のように変更してみた。
IEnumerator SaveText()
{
string path = "";
guitxt = "書き込み\n";
#if UNITY_EDITOR
path = Application.dataPath + "/" + outputTextData;
FileInfo fi = new FileInfo(path);
using (StreamWriter sw = fi.CreateText())
{
sw.WriteLine(guitxt);
}
yield return new WaitForSeconds(0f);
#elif UNITY_ANDROID
path = Application.persistentDataPath + "/" + outputTextData;
FileInfo fi = new FileInfo(path);
using (StreamWriter sw = fi.CreateText())
{
sw.WriteLine(guitxt);
}
yield return new WaitForSeconds(0f);
#endif
}
これで、動いた。
- 関連記事
-
YouTubeで動画を定期的に出しています。ご視聴いただけると嬉しいです。
Reon Labo
- 2017/03/05(日) 21:43:18|
- Unity
-
| トラックバック:0
-
| コメント:0