IEnumerator LoadText2() も
-----------------
void ReadLine()
{
string txtBuffer = "";
string path = "";
if (Application.platform == RuntimePlatform.Android)
{
// Android
path = Application.persistentDataPath + "/" + outputTextData;
FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read);
txtReader = new StreamReader(file);
guitxt2 = "1ANDROID\r\n";
}
else if (Application.platform == RuntimePlatform.WindowsEditor)
{
// Unity
path = Application.dataPath + "/" + outputTextData;
FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read);
txtReader = new StreamReader(file);
guitxt2 = "1Unity\r\n";
}
else if (Application.platform == RuntimePlatform.WindowsPlayer)
{
// Windows
path = Application.dataPath + "/" + outputTextData;
FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read);
txtReader = new StreamReader(file);
guitxt2 = "1WINDOWS\r\n";
}
else
{
}
while ((txtBuffer = txtReader.ReadLine()) != null)
{
guitxt2 = guitxt2 + txtBuffer + "\r\n";
}
}
-----------------
とか
-----------------
void ReadLine2()
{
string txtBuffer = "";
string path = "";
#if UNITY_EDITOR
path = Application.dataPath + "/" + outputTextData;
FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read);
txtReader = new StreamReader(file);
guitxt2 = "2WINDOWS\r\n";
#elif UNITY_ANDROID
path = Application.persistentDataPath + "/" + outputTextData;
FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read);
txtReader = new StreamReader(file);
guitxt2 = "2ANDROID\r\n";
#endif
while ((txtBuffer = txtReader.ReadLine()) != null)
{
guitxt2 = guitxt2 + txtBuffer + "\r\n";
}
}
-----------------
でも、おなじになる
呼び出し方は
WriteFile(guitxt);
ReadLine();
にする。
- 関連記事
-
YouTubeで動画を定期的に出しています。ご視聴いただけると嬉しいです。
Reon Labo
- 2017/03/16(木) 22:46:21|
- Unity
-
| トラックバック:0
-
| コメント:0