Beispiel #1
0
 public void MoveToOrHome()
 {
     if (moveTarget == null)
     {
         TryFindTarget();
     }
     else
     {
         movement.MoveTo(moveTarget.Value);
     }
 }
Beispiel #2
0
    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);
        }
    }
Beispiel #3
0
 public void MoveTo(Transform target)
 {
     isFree = false;
     Armament.NoAttack();
     movement.MoveTo(target);
 }