Example #1
0
    /// <summary>
    /// Activates skill if possible
    /// </summary>
    public void ActivateSkill()
    {
        if (!skill.InCooldown)
        {
            skill.Activate();

            //Check if skill activated successfully
            if (skill.InCooldown)
            {
                //Change button to darken
                ColorBlock colors = skillButton.colors;
                colors.normalColor      = new Color32(150, 150, 150, 255);
                colors.highlightedColor = new Color32(150, 150, 150, 255);
                colors.selectedColor    = new Color32(150, 150, 150, 255);
                skillButton.colors      = colors;
                cooldownSlider.gameObject.SetActive(true);
                cooldownSlider.value = 0;
            }
        }
    }