public void toggleLevelUp()
    {
        if (player != null)
        {
            if (canvas.enabled)
            {
                canvas.enabled = false;

                setAbilityActive(a1);
                setAbilityActive(a2);
                setAbilityActive(a3);
                setAbilityActive(a4);
                setAbilityActive(potion);
                setAbilityActive(passive);
            }
            else
            {
                canvas.enabled = true;

                if (player.got_ability_point())
                {
                    ability1_tree();
                    ability2_tree();
                    ability3_tree();
                    ability4_tree();
                    potion.MakeActive();
                    passive.MakeActive();
                }
            }
        }
    }
 private void setAbilityActive(abilitybutton a)
 {
     if (a.getAbilityLevel() <= 0)
     {
         a.MakeInActive();
     }
     else
     {
         a.MakeActive();
     }
 }
 private void ability3_tree()
 {
     if (a3.getAbilityLevel() <= 2)
     {
         a3.MakeActive();
     }
     else
     if (a3.getAbilityLevel() <= 4 && player.level >= 6)
     {
         a3.MakeActive();
     }
     else
     if (a3.getAbilityLevel() <= 5 && player.level >= 10)
     {
         a3.MakeActive();
     }
     else
     {
         a3.MakeInActive();
     }
 }