Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     enterMenus = GameObject.Find("EnterMenus").GetComponent <AudioSource>();
     buyCost    = PlayerPrefs.GetInt("Cost of Hero", 1000);
     buyButton.onClick.AddListener(delegate
     {
         GlobalVariable.DecreasePlayerGold(buyCost);
         buyToggleActive.GetComponent <HeroSelector>().Get_GameObject().GetComponent <Hero>().Set_Unlocked(true);
         buyToggleActive.GetComponent <HeroSelector>().ActiveHeroUnselected();
         buyToggleActive.isOn         = false;
         buyToggleActive.interactable = false;
         buyButton.interactable       = false;
         buyToggleActive = null;
         buyCost        += 100;
         PlayerPrefs.SetInt("Cost of Hero", buyCost);
     });
     upgradeButton.onClick.AddListener(delegate
     {
         GlobalVariable.DecreasePlayerGold(upgradeCost);
         upgradeToggleActive.GetComponent <HeroSelector>().Get_GameObject().GetComponent <Hero>().LevelUp();
     });
 }