Ejemplo n.º 1
0
    void Update()
    {
        if (dashing)
        {
            enemy.SetSpeed(dashSpeed);
        }

        dashTimer += Time.deltaTime;
        if (inDashRange && dashTimer >= dashCooldown)
        {
            attack();
            dashTimer = 0;
        }
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (enemy.inAction || this.WithinStopDistance())
        {
            enemy.SetSpeed(0);
        }
        else
        {
            flipTimer += Time.deltaTime;
            if (flipTimer >= flipCooldown)
            {
                enemy.LookAtTarget();
                flipTimer = 0;
            }

            enemy.SetSpeed(speed);
        }
    }