public void SetCard(ItemHeroCard card) { heroID = card.heroID; txtHeroName.text = card.txtHeroName.text; imgHero.texture = card.imgHero.texture; objEmpty.SetActive(false); }
public void EquipHeroCard(ItemHeroCard card) { if (equipedCards[0].objEmpty.activeSelf) { equipedCards[0].SetCard(card); } else if (equipedCards[1].objEmpty.activeSelf) { equipedCards[1].SetCard(card); } else if (equipedCards[2].objEmpty.activeSelf) { equipedCards[2].SetCard(card); } }
public void SetOwnedHeroesJson(JGetShopItem[] itemHeroes) { hero_owned = PlayerData.jHome.hero_owned; ownedCards = new List <ItemHeroCard> (); for (int i = 0; i < itemHeroes.Length; i++) { for (int j = 0; j < hero_owned.Length; j++) { if (hero_owned[j] == itemHeroes[i].hero_type_id) { ItemHeroCard ihc = Instantiate(prefabItemHeroCard, parentCards); ihc.SetData(itemHeroes[i]); ownedCards.Add(ihc); } } } }