IEnumerator RefreshApplyList(List <FriendInfo> RILst) { ApplyLstCover.SetActive(true); MyTools.DestroyImmediateChildNodes(ApplyGrid.transform); UIScrollView sv = ApplyGrid.transform.parent.GetComponent <UIScrollView>(); for (int i = 0; i < RILst.Count; i++) { GameObject newUnit = NGUITools.AddChild(ApplyGrid.gameObject, ApplyUnitPrefab); newUnit.SetActive(true); newUnit.name = "ApplyUnit_" + i; newUnit.transform.localPosition = new Vector3(0, -110 * i, 0); UI_FriendUnit fu = newUnit.GetComponent <UI_FriendUnit>(); fu.Set(RILst[i]); ApplyGrid.repositionNow = true; sv.ResetPosition(); yield return(new WaitForEndOfFrame()); } ApplyLstCover.SetActive(false); RefreshApplyBottomInfo(); }
IEnumerator RefreshInviteList(List <FriendInfo> RILst) { MyTools.DestroyImmediateChildNodes(InviteGrid.transform); UIScrollView sv = InviteGrid.transform.parent.GetComponent <UIScrollView>(); for (int i = 0; i < RILst.Count; i++) { GameObject newUnit = NGUITools.AddChild(InviteGrid.gameObject, InviteUnitPrefab); newUnit.SetActive(true); newUnit.name = "InviteUnit_" + i; newUnit.transform.localPosition = new Vector3(i % 2 == 1 ? 370 : 0, -110 * i, 0); UI_FriendUnit fu = newUnit.GetComponent <UI_FriendUnit>(); fu.Set(RILst[i]); InviteGrid.repositionNow = true; sv.ResetPosition(); yield return(new WaitForEndOfFrame()); } }