public void UpdateFriendInfo(UserFriendPB pb) { foreach (var v in FriendMainInfoList) { if (v.UserId == pb.UserId) { v.IsGetPower = pb.PowerGetState; v.IsGivePower = pb.PowerSendState; v.UpdateFriendPro(); } } }
public void DeleteFriend(UserFriendPB pb) { FriendInfo friendInfo = null; Debug.LogError(pb.UserId); foreach (var v in FriendMainInfoList) { Debug.LogError("v" + v.UserId); if (v.UserId == pb.UserId) { friendInfo = v; } } if (FriendMainInfoList.Contains(friendInfo)) { Debug.LogError("Remove" + friendInfo?.UserName); FriendMainInfoList.Remove(friendInfo); } }