I have an application in Unity and I have a class where I assign some buttons a text. I want the button texts to be imported from an XML file. I have done this to read the XML but I do not know how to get the data and take it to the other class.
This is my code:
Public void leerXml()
{
datos libros = null;
string path= @"C:\libros.xml"
XmlSerializer serializer = nwe xmlSerializer(typeof(datos));
StreamReader reader = new StreamReader(path);
libros = (datos)serializer.deserialize(reader):
reader.close
}
This is my XML
<libro>
<libroEjemplo>
<libro1>
<nombre>Alfredo Reino</nombre>
<email>[email protected]</email>
</libro1>
</libroEjemplo>
<libroEjemplo>
<libro2>
<nombre>Alfredo Reino</nombre>
<email>[email protected]</email>
</libro2>
</libroEjemplo>
<libro>
I think that I have it right and I read the XML data, but how can I get them and take them to another class to assign the XML texts to the buttons?