Beispiel #1
0
 /// <summary>
 /// Returns a coroutine that causes *character* to follow the path stored
 /// in this path object.
 /// </summary>
 /// <param name="steering">The steering controller for the character to move along the path</param>
 /// <returns>A coroutine you can run with StartCoroutine()</returns>
 public IEnumerator FollowPath(CharacterSteeringController steering)
 {
     while (this.WaypointsRemain(steering.Position))
     {
         steering.Seek(this.CurrentWaypoint, Speed);
         yield return null;
     }
     steering.Stop();
 }
Beispiel #2
0
 /// <summary>
 /// Returns a coroutine that causes *character* to follow the path stored
 /// in this path object.
 /// </summary>
 /// <param name="steering">The steering controller for the character to move along the path</param>
 /// <returns>A coroutine you can run with StartCoroutine()</returns>
 public IEnumerator FollowPath(CharacterSteeringController steering)
 {
     while (this.WaypointsRemain(steering.Position))
     {
         steering.Seek(this.CurrentWaypoint, Speed);
         yield return(null);
     }
     steering.Stop();
 }
Beispiel #3
0
 /// <summary>
 /// Updates the character's steering to steer along this path.
 /// </summary>
 /// <param name="steering">The steering controller for the character to move along the path</param>
 /// <returns>Whether the character has arrived at the destination.</returns>
 public bool UpdateSteering(CharacterSteeringController steering)
 {
     if (this.WaypointsRemain(steering.Position))
     {
         steering.Seek(this.CurrentWaypoint, Speed);
         return false;
     }
     steering.Stop();
     return true;
 }
Beispiel #4
0
 /// <summary>
 /// Updates the character's steering to steer along this path.
 /// </summary>
 /// <param name="steering">The steering controller for the character to move along the path</param>
 /// <returns>Whether the character has arrived at the destination.</returns>
 public bool UpdateSteering(CharacterSteeringController steering)
 {
     if (this.WaypointsRemain(steering.Position))
     {
         steering.Seek(this.CurrentWaypoint, Speed);
         return(false);
     }
     steering.Stop();
     return(true);
 }