Game Development Reference
In-Depth Information
}
public function get usersLength () : int {
return _userLength;
}
}
// C# user:
public static class XMLParser {
static XmlDocument _doc;
static XmlNode _root;
static UserData[] _users;
static int _usersLength;
public static UserData[] users {
get { return _users; }
}
public static int usersLength {
get { return _usersLength; }
}
}
4. Then, we will add the Parse() function, which will be used to parse the XML
string to the array of UserData . Let's add this method inside the XMLParser
class, as shown in the following highlighted code:
// Unity JavaScript user:
public static class XMLParser {
public function get usersLength () : int {
return _userLength;
}
public function Parse( xml : String ) : void {
_doc = new XmlDocument();
_doc.LoadXml(xml); // Loading from String
//Using doc.Load("HiScore.xml"); When load from
Search WWH ::




Custom Search