using UnityEngine;
using System.Collections;
using System.Xml;
public class Test : MonoBehaviour {
public UILabel label;
private WWW www;
void Start()
{
string url = Application.streamingAssetsPath + "/tip.xml";
label.text = url;
if (Application.platform == RuntimePlatform.Android)
{
www = new WWW(url);
}
else
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(url);
label.text = xmldoc.OuterXml;
}
}
void Update()
{
if (www!=null&&www.isDone)
{
label.text = www.text;
}
}
using System.Collections;
using System.Xml;
public class Test : MonoBehaviour {
public UILabel label;
private WWW www;
void Start()
{
string url = Application.streamingAssetsPath + "/tip.xml";
label.text = url;
if (Application.platform == RuntimePlatform.Android)
{
www = new WWW(url);
}
else
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(url);
label.text = xmldoc.OuterXml;
}
}
void Update()
{
if (www!=null&&www.isDone)
{
label.text = www.text;
}
}
}
MI 2SC 运行效果