public override void Action()
        {
            if (attackBase.attackInProgress)
            {
                return;
            }

            Vector3 diff = target.transform.position - transform.position;

            diff.Normalize();

            float rot_z = Mathf.Atan2(diff.y, diff.x) * Mathf.Rad2Deg;

            transform.rotation = Quaternion.Euler(0f, 0f, rot_z - 90);

            attackBase.StartAttack();

            OnAttack?.Invoke();
        }
예제 #2
0
 public void SetAttack(AttackBase attack)
 {
     attack.SetPower(_basePower);
     attack.StartAttack();
     _character.Attack = attack;
 }