예제 #1
0
파일: Unit.cs 프로젝트: heyx3/EscapeTheMine
 /// <summary>
 /// Finds the shortest path from this Unit to the given goal.
 /// Does not include this Unit's own position in the list.
 /// Returns "null" if a path wasn't found.
 /// IMPORTANT: The returned list is reused for other calls to this method,
 ///     so treat it as a temp variable!
 /// </summary>
 public List <Vector2i> FindPath(Pathfinding.Goal <Vector2i> goal, bool avoidEnemies)
 {
     return(TheMap.FindPath(Pos, goal, MakeHeuristic(avoidEnemies)));
 }