public void MoveToOrHome() { if (moveTarget == null) { TryFindTarget(); } else { movement.MoveTo(moveTarget.Value); } }
protected IEnumerator MoveAway(Vector3?target) { float attackDist = 1f; if (target != null) { moveTarget = target; movement.MoveTo(target.Value); } while (true) { if (moveTarget != null) { Vector3 vDist = moveTarget.Value - transform.position; vDist.y = 0; if (vDist.magnitude < attackDist) { StartCoroutine(FindConquerTarget()); yield break; } } yield return(null); } }
public void MoveTo(Transform target) { isFree = false; Armament.NoAttack(); movement.MoveTo(target); }