public void initAward(List <JSONObject> list, DDZRegtPanel.eMatchType matchType) { for (int i = 0; i < awardLbAry.Length; i++) { if (i < list.Count) { if (matchType == DDZRegtPanel.eMatchType.person3) { if (i == 0) { // string infoStr = list[i].str; // string[] infoAry = infoStr.Split(':'); // awardLbAry[i].text = "第"+infoAry[0]+"名"; // awardLbAry[i].transform.FindChild("des").GetComponent<UILabel>().text = infoAry[1]; awardLbAry[i].text = list[i].list[0].str; awardLbAry[i].transform.Find("des").GetComponent <UILabel>().text = list[i].list[1].str; } } else { if (PlatformGameDefine.game.GameTypeIDs == "9") //日赛 { if (i == 7) { awardLbAry[i].text = "第8-10名"; } else { awardLbAry[i].text = list[i].list[0].str; } } else { awardLbAry[i].text = list[i].list[0].str; } awardLbAry[i].transform.Find("des").GetComponent <UILabel>().text = list[i].list[1].str; } } } if (list.Count <= 6) { scrollView.enabled = false; } }
public void initLeaderboard(List <JSONObject> list, DDZRegtPanel.eMatchType matchtype) { if (matchtype == DDZRegtPanel.eMatchType.person3) { if (bg.height != 350) { if (PlatformGameDefine.game.GameTypeIDs == "8") { listObjTr.localPosition = new Vector3(-280.0f, 119.0f, 0); upTxtTr.localPosition = new Vector3(-398.0f, 119.0f, 0); titleLb.transform.localPosition = new Vector3(0, 183.0f, 0); lineTr.localPosition = new Vector3(0, -92.0f, 0); downTxtTr.localPosition = new Vector3(-375.0f, -138.0f, 0); scoreTxtTr.localPosition = new Vector3(76.0f, -138.0f, 0); myRankLb.transform.localPosition = new Vector3(-126.0f, -138.0f, 0); myScoreLb.transform.localPosition = new Vector3(172, -142.0f, 0); bg.height = 450; } else { listObjTr.localPosition = new Vector3(-280.0f, 76.0f, 0); upTxtTr.localPosition = new Vector3(-398.0f, 76.0f, 0); titleLb.transform.localPosition = new Vector3(0, 135.0f, 0); lineTr.localPosition = new Vector3(0, -29.0f, 0); downTxtTr.localPosition = new Vector3(-375.0f, -78.0f, 0); scoreTxtTr.localPosition = new Vector3(76.0f, -78.0f, 0); myRankLb.transform.localPosition = new Vector3(-126.0f, -78.0f, 0); myScoreLb.transform.localPosition = new Vector3(172, -82.0f, 0); bg.height = 350; } } } //[1000, 866627772, "bj123456789"], [1000, 111052, "李少"], ...] for (int i = 0; i < itemAry.Length; i++) { UILabel rankLb = itemAry[i].transform.Find("rank").GetComponent <UILabel>(); UILabel nameLb = itemAry[i].transform.Find("name").GetComponent <UILabel>(); UILabel scoreLb = itemAry[i].transform.Find("score").GetComponent <UILabel>(); if (i < list.Count) { if (matchtype == DDZRegtPanel.eMatchType.person3) { //[{"score": 0, "uid": 866627772, "rank": 0, "name": "bj123456789"}, //{"score": 0, "uid": 115299, "rank": 1, "name": "小李肥刀"}, {"score": 0, "uid": 118784, "rank": 2, "name": "晨露夕梅"}] //3人赛的结构 rankLb.text = "第" + (i + 1) + "名"; nameLb.text = list[i]["name"].str; scoreLb.text = list[i]["score"].n + "积分"; } else { rankLb.text = "第" + (i + 1) + "名"; nameLb.text = list[i].list[2].str; scoreLb.text = list[i].list[0].n + "积分"; } } else { rankLb.text = ""; nameLb.text = ""; scoreLb.text = ""; } } }
public void initAward(List <JSONObject> list, DDZRegtPanel.eMatchType matchType) { if (PlatformGameDefine.game.GameTypeIDs == "9" || PlatformGameDefine.game.GameTypeIDs == "8") //日赛 { Transform orderTr = dailypanelAward.transform.Find("grid"); Transform desTr = dailypanelAward.transform.Find("gridDes"); int len = orderTr.childCount; if (PlatformGameDefine.game.GameTypeIDs == "8") { orderTr.GetChild(0).GetComponent <UILabel>().text = list[0].list[0].str; desTr.GetChild(0).GetComponent <UILabel>().text = list[0].list[1].str; } else { for (int i = 0; i < len; i++) { if (i == 5) { orderTr.GetChild(i).GetComponent <UILabel>().text = "第6-10名"; } else { orderTr.GetChild(i).GetComponent <UILabel>().text = list[i].list[0].str; } desTr.GetChild(i).GetComponent <UILabel>().text = list[i].list[1].str; } } } else { for (int i = 0; i < awardLbAry.Length; i++) { if (i < list.Count) { if (matchType == eMatchType.person3) { if (i == 0) { //[["第1名", "1快乐卡"], ["第2名", ""], ["第3名", ""]] // string infoStr = list[i].str; // string[] infoAry = infoStr.Split(':'); // awardLbAry[i].text = "第"+infoAry[0]+"名"; // awardDesLbAry[i].text = infoAry[1]; awardLbAry[i].text = list[i].list[0].str; awardDesLbAry[i].text = list[i].list[1].str; } } else { if (PlatformGameDefine.game.GameTypeIDs == "9") //日赛 { if (i == 7) { awardLbAry[i].text = "第8-10名"; } else { awardLbAry[i].text = list[i].list[0].str; } } else { awardLbAry[i].text = list[i].list[0].str; } awardDesLbAry[i].text = list[i].list[1].str; } } } if (matchType == eMatchType.person3) { awardPanel.GetComponent <UISprite>().height = 147; Vector3 vc3 = awardPanel.transform.localPosition; vc3.y = -20; awardPanel.transform.localPosition = vc3; personLimitLb.transform.parent.gameObject.SetActive(false); countDownLb.transform.parent.gameObject.SetActive(false); } else { if (list.Count > 6) { awardPanel.GetComponent <UISprite>().height = 400; } } } }