// Update is called once per frame void Update() { if (!ImageSet) { GlobalVariable.GetHero(HeroID).GetComponent <Hero>().Set_Static(); ImageSet = true; } heroSprite.sprite = GlobalVariable.GetHero(HeroID).GetComponent <Hero>().GetSprite(); if (!Active && !Shop && !Upgrade) { heroStatDisplay.text = GlobalVariable.PrintHeroStats(HeroID); } if (Shop) { if (GlobalVariable.GetHero(HeroID).GetComponent <Hero>().Get_Unlocked()) { gameObject.GetComponent <Toggle>().interactable = false; } } else if (!GlobalVariable.GetHero(HeroID).GetComponent <Hero>().Get_Unlocked()) { gameObject.GetComponent <Toggle>().interactable = false; } else { gameObject.GetComponent <Toggle>().interactable = true; } }
void Start() { ReturnToMainMenu.onClick.AddListener(delegate { SceneManager.LoadScene("MainMenu"); }); TriggerLeaderboard.onClick.AddListener(delegate { displayLeaderboard = true; }); WaveRecord.text = "Wave Reached: " + PlayerPrefs.GetInt("Highest Wave Reached", 0).ToString(); GoldRecord.text = "Gold Earned: " + PlayerPrefs.GetInt("Most Gold Earned", 0).ToString(); KillRecord.text = "Kill Count: " + PlayerPrefs.GetInt("Most Kills", 0).ToString(); // Call stats and hero records Hero1.sprite = GlobalVariable.GetHero(PlayerPrefs.GetInt("Highest Hero_1", 1)).GetComponent <Hero>().GetSprite(); Hero2.sprite = GlobalVariable.GetHero(PlayerPrefs.GetInt("Highest Hero_2", 2)).GetComponent <Hero>().GetSprite(); Hero3.sprite = GlobalVariable.GetHero(PlayerPrefs.GetInt("Highest Hero_3", 3)).GetComponent <Hero>().GetSprite(); Stats1.text = GlobalVariable.PrintHeroStats(PlayerPrefs.GetInt("Highest Hero_1", 1)); Stats2.text = GlobalVariable.PrintHeroStats(PlayerPrefs.GetInt("Highest Hero_2", 2)); Stats3.text = GlobalVariable.PrintHeroStats(PlayerPrefs.GetInt("Highest Hero_3", 3)); lb.AddScore(PlayerPrefs.GetString("userID"), PlayerPrefs.GetInt("Highest Wave Reached", 0)); StartCoroutine(RefreshRecords()); }
public GameObject Get_GameObject() { return(GlobalVariable.GetHero(HeroID)); }