예제 #1
0
 private void CastSpell()
 {
     if (playerMana.SpendMana(1))
     {
         Instantiate(FireCone, transform.position, Quaternion.identity);
     }
     else
     {
         //not enough mana
     }
 }
예제 #2
0
    private void ButtonTriggered()
    {
        Debug.Log("button triggered");
        //Debug.Log("mana cost" + ability.manaCost);
        nextReadyTime               = coolDownDuration + Time.time;
        coolDownTimeLeft            = coolDownDuration;
        darkMask.enabled            = true;
        coolDownTextDisplay.enabled = true;

        //abilitySource.clip = ability.aSound;
        abilitySource.Play();
        Debug.Log("ability source clip " + abilitySource.name);
        manaP.SpendMana(ability.manaCost);
        //Debug.Log("mana spent");
        ability.TriggerAbility();
        Debug.Log("Triggered");
    }