unity中使用www加载本地资源

ref : https://blog.csdn.net/xiaochongsummer/article/details/76910389

 public static string xmlPath ="file:///"+ Application.streamingAssetsPath + "/messages.xml"; public static XmlDocument xmlFile=new XmlDocument (); public static WWW www; public static string contentText; public static IEnumerator LoadXml() { yield return null; www = new WWW(xmlPath); while (!www.isDone) { yield return null; } contentText = www.text; xmlFile.LoadXml(contentText); }
---------------------
作者:smuz
来源:CSDN
原文:https://blog.csdn.net/xiaochongsummer/article/details/76910389
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/kuangben2000/article/details/85105855