public void AddPokemon(int idPokemon, int count) { for (int i = 0; i < UserStatScr.QualCapsAll; i++) { if (PokedeskParent.transform.GetChild(i).GetComponent <CapsStatScr>().idCaps == idPokemon) { PokedeskParent.transform.GetChild(i).GetComponent <CapsStatScr>().quantityCaps += count; //PlayerPrefs.SetInt("IdPok-" + PokedeskParent.transform.GetChild(i).GetComponent<CapsStatScr>().idCaps.ToString(), PlayerPrefs.GetInt("IdPok-" + PokedeskParent.transform.GetChild(i).GetComponent<CapsStatScr>().idCaps.ToString()) + count); UserStatScr.QualCapsAllArray(); PokedeskParent.transform.GetChild(i).GetComponent <PokeInfoStat>().QualCaps(); break; } } }