Hi all !
I’m trying to create a Launcher for my project.
I use VS to create the launcher with a Creation of a Xml file whit Setup Value [Resolution / Windowed].
I need to read the Xml file in Unity, I use Lynq to XML, but Unity send me this :
using UnityEngine;
using System.Collections;
using System.Xml.Linq;
using System.IO;
public class ReadXML : MonoBehaviour {
public string adressHardDisk;
public XElement dataXml;
// Use this for initialization
void Start () {
dataXml = XElement.Load(adressHardDisk);
IEnumerable<XElement> data = dataXml.Elements ();
foreach (XElement item in data)
{
Debug.Log(item.Element("Width").Value);
Debug.Log (item.Element("Heigth").Value);
}
}
}
Actualy I just want to Set the Resolution choose in Launcher. I can’t test the Read of XML File cause of the error that I wrote before… When I search on the internet, everyone use :
IEnumerable<XElement / XmlElement>, and don’t have any problem…
Someone can help me plz ?