コード例 #1
0
 private void StorePatrolEnableMovement()
 {
     if (agent.hasPath)
     {
         // Keep track of where the enemy was originally headed.
         originalDestination = agent.destination;
         // ...stop the enemy's patrol.
         patrolRoute.StopPatrol();
         // Clear the agent's path.
         agent.ResetPath();
     }
     movement.enabled = true; // The enemy's movement (independent of any patrol routes) will begin now.
 }