void UserViewOnClick(UserNameAccountIdPair id)
 {
     if (OnPlayerAdded != null)
     {
         OnPlayerAdded(id);
     }
 }
    void AddUser(UserNameAccountIdPair user)
    {
        whitelistIds.Add(user.Id);
        var addedUser = Instantiate(userPrefab);

        addedUser.SetUsernameInfo(user.UserName, user.Id);
        usernameItemViews.Add(addedUser);
        addedUser.transform.SetParent(whitelistUsernamesContainer, false);
        whitelistUsernamesContainer.GetComponent <RectTransform>().sizeDelta = new Vector2(whitelistUsernamesContainer.GetComponent <RectTransform>().rect.width, addedUser.GetComponent <RectTransform>().rect.height *usernameItemViews.Count);
        addedUser.OnUserRemoved += RemoveUser;
    }
 void AddNewUser(UserNameAccountIdPair user)
 {
     if (whitelistIds.Contains(user.Id))
     {
         messagePopupView.SerErrorPopup("This user is already added to the whitelist!");
     }
     else
     {
         AddUser(user);
         Validate_OnChange();
         whitelistView.Hide();
     }
 }
 public void Init(UserNameAccountIdPair account)
 {
     usernameText.text = account.UserName;
     currentUser       = account;
 }