Exemplo n.º 1
0
 void FixedUpdate()
 {
     if ((Vector2)transform.position == (Vector2)destination.transform.position)
     {
         navAgent.LookAtTarget(destination.right);
         aiBehavior.ChangeState(aiState);
     }
 }
Exemplo n.º 2
0
 void FixedUpdate()
 {
     if ((target == null) && (targets.Count > 0))
     {
         target = GetTopTarget();
         if ((target != null) && (navAgent != null))
         {
             navAgent.LookAtTarget(target.transform);
         }
     }
     if (target == null)
     {
         if (targetState == false)
         {
             targetState = true;
         }
         else
         {
             aiBehavior.ChangeState(aiState);
         }
     }
 }