9
How to do in the Unity 3D
read a arquivo txt
line by line and store in a vector using C#.
Well, I managed to manipulate the arquivo .txt
, however in Android
it doesn’t work.
Follow the code I used.
int counter;
string line;
string[] teste = new string[10];
System.IO.StreamReader file;
file = new StreamReader("nome_do_arquivo.txt");
while ((line = file.ReadLine()) != null)
{
teste[counter] = line;
counter++;
}
file.Close();
This pc code solves my problem, however I need to Android, when compiling for Android that method doesn’t work, it’s like he didn’t take the .txt
next to the Apk
.
Another question, in the Unity 3D
used C#
for Android
, how to manipulate txt files?
With it you can read the file, and yes, you can use part of yours to popular power the array! I am without pc with Unity here to go helping in the tests!
– Junior Moreira