/// <summary> /// 设置炮弹兵详细数据 /// </summary> private void SetSoldierReward() { List <SoldierInfo> l = new List <SoldierInfo>(); CmCarbon.GetPlayerSoldier(ref l); if (MyHead.Datatable == null) { return; } for (int i = 0; i < l.Count; i++) { GameObject go = NDLoad.LoadWndItem("RoleRewardItem", MyHead.Datatable.transform); if (go != null) { RoleRewardItem item = go.GetComponent <RoleRewardItem>(); if (item != null) { item.SetRoleRewardItem(l[i]); } } } MyHead.Datatable.enabled = true; NGUIUtil.RepositionTablePivot(MyHead.Datatable.gameObject); }
private void SetSoldierReward(List <SoldierInfo> lsoldier) { if (lsoldier == null || lsoldier.Count == 0) { return; } if (MyHead.Datatable == null) { return; } for (int i = 0; i < lsoldier.Count; i++) { GameObject go = NDLoad.LoadWndItem("RoleRewardItem", MyHead.Datatable.transform); if (go != null) { RoleRewardItem item = go.GetComponent <RoleRewardItem>(); if (item != null) { item.SetRoleRewardItem(lsoldier[i]); } } } MyHead.Datatable.enabled = true; NGUIUtil.RepositionTablePivot(MyHead.Datatable.gameObject); }