public void GenButtons() { int[] tempStats; AvailableHeros.Clear(); HeroesChosen.Clear(); //populate available heros who match the tier requirements AvailableHeros = CharectorStats.heroesThatCanBeSacrificed(heroRequirements.heroType, heroRequirements.stars); if (gridButtons.Count > 0) { foreach (GameObject button in gridButtons) { Destroy(button.gameObject); } gridButtons.Clear(); } for (int i = 0; i < AvailableHeros.Count; i++) { tempStats = CharectorStats.UnlockedCharector(AvailableHeros[i]); GameObject button = Instantiate(buttonTemplate) as GameObject; gridButtons.Add(button); button.SetActive(true); button.GetComponent <TileListButton>().SetText(CharectorStats.HeroName(tempStats[1])); button.GetComponent <TileListButton>().SetSacrificeIndex(i, tempStats[0]);//also sets toggle functionality and backpackindex to the button button.transform.SetParent(buttonTemplate.transform.parent, false); } }
public void GenButtons() { AllHeros.Clear(); for (int i = 0; i < CharectorStats.numOfHeroes(); i++) { AllHeros.Add(CharectorStats.UnlockedCharector(i)); } if (buttons.Count > 0) { foreach (GameObject button in buttons) { Destroy(button.gameObject); } buttons.Clear(); } for (int i = 0; i < AllHeros.Count; i++) { GameObject button = Instantiate(buttonTemplate) as GameObject; buttons.Add(button); button.SetActive(true); button.GetComponent <TileListButton>().SetText(CharectorStats.HeroName(AllHeros[i][1])); button.GetComponent <TileListButton>().SetIndex(i); button.transform.SetParent(buttonTemplate.transform.parent, false); } }
public void InitializeMeltGrid() { int[] tempStats; MeltableList.Clear(); SelectedToMeltList.Clear(); MeltableList = CharectorStats.heroesThatCanMelt(CharectorStats.getTempHero(), xpToBeAdded, SelectedToMeltList); if (GridButtonGameObjs.Count > 0) { foreach (GameObject button in GridButtonGameObjs) { Destroy(button.gameObject); } GridButtonGameObjs.Clear(); } for (int i = 0; i < MeltableList.Count; i++) { tempStats = CharectorStats.UnlockedCharector(MeltableList[i]); GameObject button = Instantiate(buttonTemplate) as GameObject; GridButtonGameObjs.Add(button); button.SetActive(true); button.GetComponent <EnhanceListButton>().SetText(CharectorStats.HeroName(tempStats[1])); button.GetComponent <EnhanceListButton>().SetHeroNum(tempStats[0]); button.GetComponent <EnhanceListButton>().SetIndex(i); button.transform.SetParent(buttonTemplate.transform.parent, false); } }
public void TransferToSelected() { int[] tempStats; int tempxp = 0; //Insert function to gray out tile on grid ClearSelectedGameObjs(); for (int i = 0; i < SelectedToMeltList.Count; i++) { tempStats = CharectorStats.UnlockedCharector(SelectedToMeltList[i]); tempxp = tempStats[4]; GameObject button = Instantiate(selectedBtnTemplate) as GameObject; MeltingButtonGameObjs.Add(button); button.SetActive(true); button.GetComponent <SelectedToMeltBtn>().SetText(CharectorStats.HeroName(tempStats[1])); button.GetComponent <SelectedToMeltBtn>().SetIndex(i); button.GetComponent <SelectedToMeltBtn>().SetHeroNum(tempStats[0]); button.transform.SetParent(selectedBtnTemplate.transform.parent, false); } xpToBeAdded += tempxp; }
public void SetHeroNameText() { int[] nameTemp = CharectorStats.setTempHero(CharectorStats.getTempHero()); heroText.text = CharectorStats.HeroName(nameTemp[0]); }
void SetHero() { CharectorStats.SetCurrentHero(CharectorStats.getTempHero()); Debug.Log("Hero is now: " + CharectorStats.SetCurrentHero(CharectorStats.GetCurrentHero())[0] + CharectorStats.HeroName(CharectorStats.SetCurrentHero(CharectorStats.GetCurrentHero())[0])); PlayServices.Instance.SaveData(); }