Ejemplo n.º 1
0
 void CreateOrUpdateAStartFind()
 {
     GenOBs();
     GenPlane();
     if (aStarFind == null)
     {
         aStarFind = new AStarFind(grids);
     }
     else
     {
         aStarFind.UpdateGrids(grids);
     }
 }
Ejemplo n.º 2
0
 public void DoMove(AStarFind aStarFind, Vector3 startPos, Vector3 endPos)
 {
     GenerateCollider();
     this.endPos        = endPos;
     this.startPos      = startPos;
     transform.position = this.startPos;
     pathList           = new List <Vector3>();
     this.aStarFind     = aStarFind;
     pathList           = aStarFind.GetPath(startPos, endPos);
     if (pathList != null && pathList.Count > 0)
     {
         pathList.Insert(0, startPos);
         pathList.Add(endPos);
     }
     //DrawPathLine();
     isMoving = true;
 }