using System;
using System.Xml;
using System.Collections.Gerneric;
using System.UnityEngine;
public class CreateXml{
string fileURL = Application.dataPath + "/filename.xml";
public DoAction(){
if(!File.exists(fileURL)){
XmlDocument xmlName = new XmlDocument();
Element rootElement = xmlName.CreateElement("rootName");
Element childElement = xmlName.CreateElement("childName");
childElement.InnerText = "childText";
rootElement.AppendChild(childElement);
xmlName.AppendChild(rootElement);
xmlName.Save(fileURL);
}
}
}
使用MonoBehaviour创建xml文件
最新推荐文章于 2023-05-19 11:37:47 发布