Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C# by huy ( 7 years ago )
IEnumerator getdataTop (){
WWW test= new WWW ("http://www.adventuremobilegames.com/leaderboardudid/index_new/banca/"+SystemInfo.deviceUniqueIdentifier+"/aaa/1/100");
//Debug.Log ("http://www.adventuremobilegames.com/leaderboardudid/index_new/banca/"+SystemInfo.deviceUniqueIdentifier+"/aaa/1/3");
yield return test;
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml (test.text);
XmlNodeList levelsList = xmlDoc.GetElementsByTagName("id");
int temp = 0;
foreach (XmlNode levelInfo in levelsList) {
XmlNodeList levelcontent = levelInfo.ChildNodes;
foreach (XmlNode levelsItens in levelcontent){ // levels itens nodes.
if(levelsItens.Name == "rank"){
//_rank_top[temp] = levelsItens.InnerText; // put this in the dictionary.
GameObject cell = NGUITools.AddChild(gridRank,labelRankLB );
cell.GetComponent<UILabel> ().text = levelsItens.InnerText;
if (temp == 2)
cell.GetComponent<UILabel> ().color = Color.magenta;
}
if(levelsItens.Name == "username"){
//_username_top[temp] = levelsItens.InnerText; // put this in the dictionary.
GameObject cell1 = NGUITools.AddChild(gridName,labelNameLB );
cell1.GetComponent<UILabel> ().text = levelsItens.InnerText;
if (temp == 2)
cell1.GetComponent<UILabel> ().color = Color.magenta;
}
if(levelsItens.Name == "score"){
//_score_top[temp] = levelsItens.InnerText; // put this in the dictionary.
GameObject cell2 = NGUITools.AddChild(gridScore,labelScoreLB );
cell2.GetComponent<UILabel> ().text = levelsItens.InnerText;
if (temp == 2)
cell2.GetComponent<UILabel> ().color = Color.magenta;
}
}
temp++;
if (temp == 5) {
GameObject cell = NGUITools.AddChild(gridRank,labelRankLB );
cell.GetComponent<UILabel> ().text = "-";
GameObject cell1 = NGUITools.AddChild(gridName,labelNameLB );
cell1.GetComponent<UILabel> ().text = "-";
GameObject cell2 = NGUITools.AddChild(gridScore,labelScoreLB );
cell2.GetComponent<UILabel> ().text = "-";
}
}
gridName.GetComponent<UIGrid> ().Reposition();
gridRank.GetComponent<UIGrid> ().Reposition();
gridScore.GetComponent<UIGrid> ().Reposition();
}
Revise this Paste