XML creation and modification in Unity, examples of backpack items

using UnityEngine;
using System.Collections;
using System.Xml;

public class XmlParse : MonoBehaviour {

    //文件路径
    private string filePath = string.Empty;
    private string fileName="/BagConfig.xml";

    void Start () {         filePath = Application.streamingAssetsPath + fileName;     // AddNode ();         AddNum (2000,50);     }     void AddNode(){         // Create a file factory for XML file parsing         XmlDocument doc = new XmlDocument ();         doc. Load(filePath);







        //Find the root node
        XmlNode rootNode = doc.SelectSingleNode ("Bag");

Guess you like

Origin blog.csdn.net/Star_MengMeng/article/details/122898834