private void _OnShowCenter() { if (_controller.isShowBlackBg == true) { img_bg.color = new Color(0, 0, 0, 1); } EventTriggerListener.Get(_btnExit.gameObject).onClick = (obj) => { Audio.AudioManager.Instance.BtnMusic(); _ClosePanel(); }; _setBtnType(btn_activeRank, "活跃榜"); for (var i = 0; i < 11; i++) { RankItem tmpRankItem; if (i == 0) { tmpRankItem = new RankItem(); tmpRankItem.InitItem(rankItem.gameObject); rankItemList.Add(tmpRankItem); } else { var tmpBtn = rankItem.gameObject.CloneEx().GetComponent <Button>(); tmpBtn.transform.SetParent(rankItem.transform.parent); tmpBtn.transform.position = rankItem.transform.position; tmpBtn.transform.localScale = Vector3.one; tmpBtn.transform.rotation = rankItem.transform.rotation; tmpRankItem = new RankItem(); tmpRankItem.InitItem(tmpBtn.gameObject); rankItemList.Add(tmpRankItem); } } updateRank(RankType.ActiveType); }
/// <summary> /// Sets the rank infor. 需要填充数据的btn , 排行的数据 , 排行榜的类型0 是活跃排行榜 1等级排行榜 2.资产排行榜 /// </summary> /// <param name="target">Target.</param> /// <param name="tmpvo">Tmpvo.</param> /// <param name="rankType">Rank type.</param> private void _setRankInfor(RankItem target, GameRankVo tmpvo, int rankType) { target.UpateData(tmpvo, rankType); }