2
我需要創建一個XML文本文件,並通過(使用框)使用腳本在場景中的文本顯示?我創建了一個xml文本文件,即位於c Drive中。請參閱我的下面的代碼,並通過使用C#幫助我。下面的代碼使用ngui標籤。但使用框顯示很好。如何使用腳本創建xml文本並在場景中顯示文本?
using UnityEngine;
using System.Collections;
using System.Xml;
using System.IO;
public class Xml : MonoBehaviour
{
// Use this for initialization
void Start()
{
XmlDocument xml=new XmlDocument();
xml.Load(Application.dataPath+"/Resources/text.xml");
}
// Update is called once per frame
void Update() { }
void OnGUI()
{
UILabel subtitle = GameObject.Find("Label").GetComponent();
subtitle.text = "";
}
}
太謝謝你了.... – KasiReddy