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
最新推荐文章于 2023-07-25 09:31:25 发布