public void RemovePlayerProfilePanel(PlayerProfileInfo playerProfileInfo)
 {
     if (PanelsContainsInfo(playerProfileInfo))
     {
         RemovePanel(playerProfileInfo);
     }
 }
    public void AddNewPlayerProfilePanel(PlayerProfileInfo playerProfileInfo)
    {
        PlayerProfilePanel panel = GetNextProfilePanel();

        panel.Setup(playerProfileInfo);
        panel.gameObject.SetActive(true);
    }
 public void AddPlayerProfilePanel(PlayerProfileInfo playerProfileInfo)
 {
     Debug.Log("Add player profile panel");
     if (!PanelsContainsInfo(playerProfileInfo))
     {
         AddNewPlayerProfilePanel(playerProfileInfo);
     }
 }
 public void RemovePanel(PlayerProfileInfo playerProfileInfo)
 {
     for (int i = 0; i < playerProfilePanels.Count; i++)
     {
         if (playerProfilePanels[i].playerProfileInfo.id == playerProfileInfo.id)
         {
             playerProfilePanels.RemoveAt(i);
         }
     }
 }
    public bool PanelsContainsInfo(PlayerProfileInfo playerProfileInfo)
    {
        for (int i = 0; i < playerProfilePanels.Count; i++)
        {
            if (playerProfilePanels[i].playerProfileInfo.id == playerProfileInfo.id)
            {
                return(true);
            }
        }

        return(false);
    }
Exemple #6
0
 public void Setup(PlayerProfileInfo playerProfileInfo)
 {
     this.playerProfileInfo = playerProfileInfo;
     nameText.text          = playerProfileInfo.name;
     profileImage.sprite    = playerProfileInfo.profileImage;
 }