public AttackState(Unit unit, HitPoints target) { this.unit = unit; Debug.Log($"{unit.name} started attacking {target.name}."); this.target = target; targetRadius = target.GetComponent <ObjectRadius>(); }
public ChaseState(Unit unit, HitPoints target, float stopDistance) { this.target = target; this.stopDistance = stopDistance; agent = unit.Agent; agent.speed = unit.CurrentJob.movementSpeed; path = new NavMeshPath(); targetRadius = target.GetComponent <ObjectRadius>(); }