Exemplo n.º 1
0
    private IEnumerator Skill1Effect()
    {
        yield return(new WaitForSeconds(2));

        MeleeSkill1.transform.parent = null;
        MeleeSkill1.SetActive(false);
    }
Exemplo n.º 2
0
 public void ActivateSpell1()
 {
     if (CurrentTarget)
     {
         MeleeSkill1.SetActive(true);
         MeleeSkill1.transform.position = CurrentTarget.transform.position;
         MeleeSkill1.transform.parent   = CurrentTarget.transform;
         //Rigidbody rb = CurrentTarget.GetComponent<Rigidbody>();
         //StartCoroutine(CurrentTarget.PushBackEnd());
         //rb.AddForce(gameObject.transform.forward * CurrentTarget.PushBackForce);
         CurrentTarget.TakeDamage(skills[SkillIndex].SpellDamage, transform, IsCrit());
         StartCoroutine(Skill1Effect());
         Mana -= skills[SkillIndex].SpellManaCost;
         StartCoroutine(skills[SkillIndex].CoolDownTimer());
     }
 }