protected override void OnEventFired(object source, EventArgs args) { UnityAsyncHelper.UnityMainThreadContext.PostAsync(async() => { CharacterFriendListResponseModel friendsResponse = await SocialService.GetCharacterListAsync(); foreach (int characterId in friendsResponse.CharacterFriendsId) { NetworkEntityGuid entityGuid = NetworkEntityGuidBuilder.New() .WithType(EntityType.Player) .WithId(characterId) .Build(); FriendAddedPublisher.PublishEvent(this, new CharacterFriendAddedEventArgs(entityGuid)); } }); }