public void CreateFriendListItem(CreateInviteFriendListItemEvent e, OnlineFriendNode friend, [JoinSelf] Optional <OnlineFriendInBattleNode> friendInBattle, [JoinAll] SingleNode <InviteFriendsListComponent> inviteFriendsList, [JoinAll] SelectedBattle selectedBattle) { if (!friendInBattle.IsPresent() || (friendInBattle.Get().battleGroup.Key != selectedBattle.Entity.Id)) { this.CreateFriendListItem(friend.Entity.Id, inviteFriendsList.component); } }
public void ShowInvitedFriendNotification(UserLabelClickEvent e, SingleNode <UserLabelComponent> userLabel, [JoinByUser] SingleNode <InviteFriendListItemComponent> friendUI, [JoinByUser] SingleNode <AcceptedFriendComponent> friend, [JoinAll] SelectedBattle battle, [JoinAll] SingleNode <InviteFriendsConfigComponent> inviteFriendsConfig) { friendUI.component.UserLabelContainer.SetActive(false); friendUI.component.NotificationContainer.SetActive(true); base.NewEvent <HideInvitedFriendNotificationEvent>().Attach(friend).ScheduleDelayed(inviteFriendsConfig.component.InviteSentNotificationDuration); base.ScheduleEvent(new InviteFriendToBattleEvent(battle.Entity.Id), friend); }
public void AddFriendToList(NodeRemoveEvent e, FriendInBattleNode friendInBattle, [JoinSelf] OnlineFriendNode friend, [JoinByBattle] SelectedBattle battle, [JoinAll] SingleNode <InviteFriendsListComponent> inviteFriendsList) { this.CreateFriendListItem(friend.Entity.Id, inviteFriendsList.component); }
public void RemoveFriendFromList(NodeAddedEvent e, OnlineFriendInBattleNode onlineFriend, [JoinByBattle] SelectedBattle battle, OnlineFriendInBattleNode onlineFriendToUi, [Context, JoinByUser] SingleNode <InviteFriendListItemComponent> listItem) { Object.Destroy(listItem.component.gameObject); }