Question by
jfranciscoarellano · Dec 25, 2016 at 10:33 PM ·
textasset
how to write on textasset parameter
public int Npregunta; public char turesp; public TextAsset textoX;
public void responde()
{
int longitud = 30;
var eso = new MemoryStream (textoX.bytes);
StreamReader sr = new StreamReader(eso);
char[] c = null;
c = new char[longitud];
sr.Read(c, 0, c.Length);
sr.Close ();
if (c[Npregunta-1] == turesp)
c[Npregunta-1] = 'n';
else {
c[Npregunta - 1] = turesp;
}
//StreamWriter sw= new StreamWriter(eso);
StreamWriter sw= new StreamWriter("Assets/Resources/Ex1P2.txt");
sw.Write (c, 0, longitud);
sw.Close ();
}
Comment
i have that code, and i want to chanche line 19, to be working perfectly on android cellphone, i hope u can help me
public int Npregunta; public char turesp; public TextAsset textoX; textoX is added in unity manualy