Ejemplo n.º 1
0
    private void PerformAttackOnBase()
    {
        BaseHealth _base = target.GetComponent <BaseHealth>();

        if (attackObject != null && !_base.IsDead())
        {
            animator.Play("Right Throw");
            GameObject rangeAttackObject = (GameObject)Instantiate(attackObject, this.transform);
            rangeAttackObject.transform.Translate(new Vector3(0, 3f, 0));
            rangeAttackObject.GetComponent <RangeAttack>().Seek(this.target, this.attackDamage);
        }
        else if (!_base.IsDead())
        {
            animator.Play("Melee Right Attack 01");
            _base.TakeDamage(this.attackDamage);
        }
        else
        {
            attackTimer = 1.25f;
            target      = null;
        }
    }