public void Refresh() { GameMainManager.instance.netManager.GetRecallableFriends((ret, res) => { /* * res.data.recall_friend_rewards = new ShareData.RecallableFriendData[10]; * for(int i = 0;i< res.data.recall_friend_rewards.Length;i++) * { * res.data.recall_friend_rewards[i] = new ShareData.RecallableFriendData(); * res.data.recall_friend_rewards[i].name = "游客"+i.ToString(); * res.data.recall_friend_rewards[i].uid = 123 + i; * res.data.recall_friend_rewards[i].head_img = "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1018364764,1223529536&fm=27&gp=0.jpg"; * }*/ if (res.isOK) { if (res.data.recall_friend_rewards != null) { GameMainManager.instance.model.userData.recallableList = new List <ShareData.RecallableFriendData>(res.data.recall_friend_rewards); recallableList = new List <RecallFriendData>(); foreach (ShareData.RecallableFriendData friend in res.data.recall_friend_rewards) { RecallFriendData data = new RecallFriendData(); data.data = friend; data.isSelected = true; recallableList.Add(data); } scrollView.SetData(recallableList); } else { GameMainManager.instance.model.userData.recallableList = new List <ShareData.RecallableFriendData>(); } } else { Alert.Show(res.errmsg); } }); }
public override void SetData(object data) { this.data = data as RecallFriendData; toggle.isOn = this.data.isSelected; headIcon.setData(this.data.data.name, this.data.data.head_img, 0, this.data.data.isVip); }