Hello
so sorry that I ask same question twice, for some reasons that I didn’t understand, my previous question didn’t appear like it should and I couldn’t edit it.
I am trying to write a program about buildings information with some gaming features, and I have a dialog system here, I am using “<” symbol for some process and I get this error.
Assets/ChatNPC.cs(48,65): error CS1525: Unexpected symbol `<', expecting `)', `,', `;', `[', or `='
many thanks in advance ! and here is my code :
using System.Xml;
public class ChatNPC : MonoBehaviour {
//building data
private string buildingName;
private string buildingType;
//info data
public int maxdata;
public int showdata;
private string [] data;
private XmlReader reader;
void OnGUI (){
if (showdata < maxdata) {
GUI.Label (Rect (0,0,200,20), buildingType +":" +buildingName);
GUI.Label (Rect (0,20,200,10) ,data [showdata]);
if (GUI.Button(Rect (0,120,200,20) , "Next"))
{
showdata++;
if (showdata>maxdata)
showdata = 0;
}
}
}
// Use this for initialization
void Start () {
maxdata = 0;
showdata = 0;
buildingName = "Unset";
buildingType = "Unset";
data = null;
reader = XmlReader.Create ("chat.xml");
while (reader.Read()) {
if (reader.IsStartElement("buildings"))
{
buildingName = reader.GetAttribute("name");
buildingType = reader.GetAttribute("buildingsType");
maxdata = reader.GetAttribute("entries");
data = new string[maxdata];
for (int showdata = 0, showdata < maxdata, showdata++)
{
reader.Read();
if (reader.IsStartElement("text"))
{
data[showdata] = reader.ReadString();
}
}
showdata=0;
}
}
}