I dont' know if title of the post is correct to 100% but this is my problem.
i have a class that load a text file, the name of the file is inside a variable (we say ie filename) and a funtion LoadText, load regular text file (made of strings that end with "\n"
So if i use a button that work with OnCLick to call LoadText after changing the filename inside my class, well it load the text file normally, but if i put this button inside a UIWrapContent (because i need several button inside an endless scroll view) unity say ne when click:
ArgumentException: path contains invalid characters.
So for resume...this is LoadText
public void LoadText (string nome)
{
Debug.Log (nome);
if (sr != null)
sr.Dispose ();
sr = new StreamReader ("Assets/Resources/"+nome + ".txt");
temp = sr.ReadToEnd ();
sr.Close ();
}
// prodwrap.GetComponent<UIWrapContent>().WrapContent();
prodwrap.SetActive(true);
}
if i use in start or on enable when the button is inside uiwrap IT WORK but at second click it give the error on line with new StreamReader. i f i use it on a button with parent UIRoot it works at 100%, can changing name at runnign and reload relative text file whitout problems..
I hope i'm clear..