public void LoadCurrentRoundHeroes() { currentSelection = 1; clearRoundButton.SetActive(true); content.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 1.25f); for (int i = 0; i < currentRoundHeroes.Count; i++) { string pathFolder = currentRoundHeroes[i].heroFaction.ToString(); CardButton btn = Instantiate(cardBtnPrefab) as CardButton; btn.Init(currentRoundHeroes[i], pathFolder); btn.transform.SetParent(content, false); } }
public void AddCardToCurrentRound() { if (currentCard != null) { currentRoundHeroes.Add(currentCard); addCardButton.interactable = false; removeCardButton.interactable = true; if (currentSelection == 1) { string pathFolder = currentCard.heroFaction.ToString(); CardButton btn = Instantiate(cardBtnPrefab) as CardButton; btn.Init(currentCard, pathFolder); btn.transform.SetParent(content, false); } } }
public void CreateCardScrollList(string type) { currentSelection = 0; CardData[] currentData = new CardData[] { }; string pathOverride = ""; switch (type) { case "Basics": currentData = basicCards; break; case "Tactics": currentData = tacticCards; break; case "DelayTactics": currentData = delayTacticCards; break; case "Weapons": currentData = weaponCards; break; case "Armors": currentData = armorCards; break; case "Mounts": currentData = mountCards; break; case "Treasures": currentData = treasureCards; break; case "Heroes_Red": currentData = heroes_redCards; pathOverride = "Red"; break; case "Heroes_Green": currentData = heroes_greenCards; pathOverride = "Green"; break; case "Heroes_Blue": currentData = heroes_blueCards; pathOverride = "Blue"; break; case "Heroes_Colorless": currentData = heroes_ColorlessCards; pathOverride = "Colorless"; break; case "Heroes_God": currentData = heroes_GodCards; pathOverride = "God"; break; } content.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 1.25f); for (int i = 0; i < currentData.Length; i++) { CardButton btn = Instantiate(cardBtnPrefab) as CardButton; btn.Init(currentData[i], pathOverride); btn.transform.SetParent(content, false); } }