public IEnumerator LoadXmlData(int level)
{
string path = "/levels/map" + level + ".tmx";
string filePath;
if (Application.platform == RuntimePlatform.Android)
{
filePath = Application.streamingAssetsPath + path;
}
else
{
filePath = "file://" + Application.streamingAssetsPath + path;
}
UnityWebRequest request = UnityWebRequest.Get(filePath);
yield return request.SendWebRequest();
Debug.Log("LoadXmlData");
Debug.Log(request.downloadHandler.text);
XmlDocument xDo = new XmlDocument();
xDo.LoadXml(request.downloadHandler.text);
//CMapData = loadMap(xDo);
}
Unity 加载 xml
最新推荐文章于 2024-06-30 15:28:52 发布