On unity documents, Streaming assets are pressed to jar file.
I played my game on android, My text file on streaming assets did not be loaded.
string path = Application.streamingAssetsPath + "/" + filename;
if(Application.platform == RuntimePlatform.Android)
{
path = "jar:file://" + Application.dataPath + "!/assets/" + filename;
}
if (File.Exists(path))
{
FileStream file = new FileStream (path, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader( file );
string str = null;
str = sr.ReadLine ();
sr.Close();
file.Close();
return str;
}
else
{
return null;
}
this is my code of read file.
I need your help T.T