unity3d解析xml文件|想要用unity3d做游戏有人推荐用xml写存档求教

㈠ unity3d 读本地的一个xml文件数据,在play的时候是可以读的,但是做网络发布之后就读不到数据了,求解答

………这不是废话吗,网络发布以后xml文件地址肯定变了

㈡ Unity5怎么读取到Resources文件下的XML文件啊

XmlDocument xml = new XmlDocument(); xml.Load(Application.dataPath+"/Resources/"+"new.xml"); XmlNode root = xml.DocumentElement;

㈢ 想要用unity3d做游戏,有人推荐用xml写存档,求教

可以用Unity自身的PlayerPrefs类来做一些简单的数据存储,具体用法可以参照API如果你用C#作为脚本语言的话,还可以用一个xml文件来存储数据

㈣ Unity C# 在手机上如何解析XML

将引用的xml相关dll文件放在unity assets下的plugin目录下即可

㈤ unity中怎样读取xml文档

我不知道你有么有new一下,而且加载的时候直接用XmlDocument xmlDoc = new XmlDocument ();xmlDoc.Load (Application.dataPath+"/playerDate.xml");就行了啊,没必要是Loadxml啊

㈥ unity3d可否转化成hxml

unity3d导出obj的方法如下: 从Terrain菜单下选择Export To Obj… ,在分辨率窗口,选择要四内边形还是三角形网格容结构。同样也可以选择要导出地形的分辨率,有高中低等等.点击Export,选择要保存的位置和文件名.Obj文件将被导出.要注意如果选择大面积…

㈦ Unity3D 配置文件

用.net的xml解析就可以了。一样使用的,路径可以用unity提供的借口Application.dataPath来获得项目的相对路径。

㈧ 如何在unity发布网页之后读取xml

当unity发布为web之后,想要运行之后在本机上面保存一个xml文件,并且读取,目前只找到了读取的方法。其实就是把本机当成是一个服务器端,web运行的时候从本机的URL上面读取一个xml文件,注意要把crossdomain.xml保存到c盘的wwwroot目录下 ,然后将要读取的xml文件放到发布之后的web文件下面的templets文件夹里面 ,unity代码: using UnityEngine; using System.Collections; using System.Xml; using System; using System.Text; using System.Collections.Generic; public class Test1 : MonoBehaviour { public string timeURL; public string all; public string id; public string start; public string end; public string content; public string fdate; public string idate; private string erro1; private string erro2; private string erro3; // Use this for initialization void Start() { timeURL = "http://127.0.0.1:82/templets/area.xml"; //这里填写格式 StartCoroutine(GetXML()); } IEnumerator GetXML() { Debug.Log("Start get GetXML"); WWW www = new WWW(timeURL); while (!www.isDone) { Debug.Log("Getting GetXML"); yield return www; all = www.text; Debug.Log("Finish getting GetXML and whole xml is : " + www.text); ParseXml(www); } } public void ParseXml(WWW www) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(www.text); XmlNodeList nodeList=xmlDoc.SelectSingleNode("list").ChildNodes; foreach(XmlElement xe in nodeList) { id = xe.GetAttribute("id"); start = xe.GetAttribute("start"); end = xe.GetAttribute("end"); content = xe.GetAttribute("content"); fdate = xe.GetAttribute("fdate"); idate = xe.GetAttribute("idate"); } } void OnGUI() { GUI.Label(new Rect(100,00,200,200),all); GUI.Label(new Rect(0,00,200,200),id); GUI.Label(new Rect(0,30,200,200),start); GUI.Label(new Rect(0,60,200,200),end); GUI.Label(new Rect(0,90,200,200),content); GUI.Label(new Rect(0,120,200,200),fdate); GUI.Label(new Rect(0,150,200,200),idate); } }

㈨ Unity如何用XMLParser修改.xml文件

一般对于XML文件都是以读取为主,如果要写入的话,用XMLParser是不行的,一般是用System.Xml。可以用里面的XmlDocument.CreateElement方法来写入节点,还是蛮方便的。具体可以去看看MSDN。


赞 (0)