daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Jul 23rd, 2017 123 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/Assets/AstarPathfindingProject/Core/AI/AIPath.cs b/Assets/AstarPathfindingProject/Core/AI/AIPath.cs
  2. index a8d9bb83..96256375 100644
  3. --- a/Assets/AstarPathfindingProject/Core/AI/AIPath.cs
  4. +++ b/Assets/AstarPathfindingProject/Core/AI/AIPath.cs
  5. @@ -295,6 +295,12 @@ public class AIPath : MonoBehaviour {
  6.         return tr.position;
  7.     }
  8.  
  9. +   protected virtual IMovementPlane MovementPlaneFromNode (GraphNode node) {
  10. +       var graph = AstarData.GetGraph(node) as ITransformedGraph;
  11. +
  12. +       return graph != null ? graph.transform : GraphTransform.identityTransform;
  13. +   }
  14. +
  15.     protected virtual void Update () {
  16.         if (!canMove) return;
  17.  
  18. @@ -302,8 +308,7 @@ public class AIPath : MonoBehaviour {
  19.             velocity2D = Vector3.zero;
  20.         } else {
  21.             var currentPosition = GetFeetPosition();
  22. -           var graph = AstarData.GetGraph(path.path[0]) as ITransformedGraph;
  23. -           IMovementPlane movementPlane = graph != null ? graph.transform : GraphTransform.identityTransform;
  24. +           var movementPlane = MovementPlaneFromNode(path.path[0]);
  25.  
  26.             interpolator.MoveToLocallyClosestPoint(currentPosition, true, false);
  27.             interpolator.MoveToCircleIntersection2D(currentPosition, pickNextWaypointDist, movementPlane);
RAW Paste Data
Top