Beispiel #1
0
    private void FixedUpdate()
    {
        AttackType.DoType();

        if (AttackTarget)
        {
            timeAttack -= Time.fixedDeltaTime;
            if (timeAttack < 0)
            {
                attackDirection   = AttackTarget.transform.position - owner.transform.position;
                attackDirection.y = 0;
                if (attackDirection.magnitude < attckDistance)
                {
                    EventAttack();
                }
            }
        }
        else
        {
            AttackTarget = owner.FindTarget();
            isAttack     = false;
        }
    }