Пример #1
0
    // Use this for initialization
    void Start()
    {
        canvas = GetComponent <Canvas>();
        disable();

        foreach (abilitybutton ab in FindObjectsOfType <abilitybutton>())
        {
            switch (ab.b)
            {
            case Buttons.ability1:
                a1 = ab;
                break;

            case Buttons.ability2:
                a2 = ab;
                break;

            case Buttons.ability3:
                a3 = ab;
                break;

            case Buttons.ability4:
                a4 = ab;
                break;

            case Buttons.passive:
                passive = ab;
                break;

            case Buttons.potion:
                potion = ab;
                break;
            }
        }
    }
Пример #2
0
 private void setAbilityActive(abilitybutton a)
 {
     if (a.getAbilityLevel() <= 0)
     {
         a.MakeInActive();
     }
     else
     {
         a.MakeActive();
     }
 }