Ejemplo n.º 1
0
 public void buySpecificHero()
 {
     if (!buyToggleActive)
     {
         buyToggleActive = ToggleGroupExtension.GetActive(UnBoughtHeroes);
     }
     else if (buyToggleActive)
     {
         buyToggleActive.GetComponent <HeroSelector>().ActiveHeroSelected();
         if (!buyToggleActive.isOn)
         {
             buyButton.interactable = false;
             buyToggleActive.GetComponent <HeroSelector>().ActiveHeroUnselected();
             buyToggleActive = null;
         }
     }
 }
Ejemplo n.º 2
0
 public void upgradeSpecificHero()
 {
     if (!upgradeToggleActive)
     {
         upgradeToggleActive = ToggleGroupExtension.GetActive(upgradeHeroes);
     }
     else if (upgradeToggleActive)
     {
         upgradeCost = 50 * (upgradeToggleActive.GetComponent <HeroSelector>().Get_GameObject().GetComponent <Hero>().Get_Level() + 1);
         upgradeToggleActive.GetComponent <HeroSelector>().ActiveHeroSelected();
         if (!upgradeToggleActive.isOn)
         {
             upgradeButton.interactable = false;
             upgradeToggleActive.GetComponent <HeroSelector>().ActiveHeroUnselected();
             upgradeToggleActive = null;
         }
     }
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (!bothSelected)
        {
            if (!active)
            {
                active = ToggleGroupExtension.GetActive(EquippedHeroes);
            }
            if (!active2)
            {
                active2 = ToggleGroupExtension.GetActive(UnEquippedHeroes);
            }

            if (active && !active.isOn)
            {
                active.GetComponent <HeroSelector>().ActiveHeroUnselected();
                active = null;
            }
            else if (active && active.isOn)
            {
                active.GetComponent <HeroSelector>().ActiveHeroSelected();
            }
            if (active2 && !active2.isOn)
            {
                active2 = null;
            }

            if (active && active2)
            {
                if (active.isOn && active2.isOn)
                {
                    bothSelected = true;
                }
            }
        }
        else if (bothSelected)
        {
            Swap();
        }
    }