When i test my xml in unity program , it works so great . so i build a game . but when i try it with a game that i buid , it doesn’t work .
This is my script for write XML
using (XmlWriter writer = XmlWriter.Create("Assets/Data/sound.xml")) {
writer.WriteStartElement ("sound");
writer.WriteElementString ("SFX", "no");
writer.WriteElementString ("MUSIC", "no");
writer.WriteEndElement ();
writer.Flush ();
}
this is my script for read xml
XmlDocument doc = new XmlDocument();
doc.Load("Assets/Data/sound.xml");
XmlNode root = doc.DocumentElement;
XmlNode myNode = root.SelectSingleNode("SFX");
if (myNode.InnerText == "no") {
var shotTransform = Instantiate (x) as Transform;
shotTransform.position = transform.position;
Destroy (gameObject);
}
i dont know why it doesn’t work with build version .
any idea?