Example #1
0
 internal void clear()
 {
     _grid      = null;
     _startNode = null;
     _endNode   = null;
     _binaryHeaps.Dispose();
     _path = null;
 }
Example #2
0
        void Awake()
        {
            if (_grid == null)
            {
                _grid = GetComponent <AStarGrid>();
            }

            _requestManager = GetComponent <PathRequestManager>();
        }
Example #3
0
 internal bool findPath(AStarGrid grid)
 {
     if (_grid != null)
     {
         clear();
     }
     _grid         = grid;
     _startNode    = _grid.startNode;
     _endNode      = _grid.endNode;
     _startNode._g = 0;
     _startNode._h = _heuristic(_startNode, _endNode);
     _startNode._f = _startNode._g + _startNode._h;
     return(search());
 }