Exemple #1
0
    public override void Execute()
    {
        timerDash += Time.deltaTime;

        melee.collider.enabled = false;

        melee.enemy_navmesh.isStopped = false;

        melee.enemy_navmesh.Move(melee.GetDirectionFromTo_N(startPosition, endPosition) * 0.25f);

        melee.enemy_animator.SetBool("Attack", true);


        melee.enemy_animator.enabled = true;

        Collider[] entities = Physics.OverlapSphere(transform.position, 2);

        foreach (Collider col in entities)
        {
            if (col.gameObject.tag == "Player" && !dmg_done)
            {
                AddDamage();
            }
        }

        if (timerDash >= 0.25f)
        {
            FinishAttack();
        }
    }