Ejemplo n.º 1
0
 void DoPathfinding()
 {
     if (UpdateCurrentCell())
     {
         if (m_currentCell != null && m_selectedUnit.IsValidDestination(m_currentCell))
         {
             ClearPaths();
             HexGrid.FindPathTo(m_selectedUnit.Location, m_currentCell, m_selectedUnit, m_pathFindingResults);
             DrawStartEndPath(m_pathFindingResults, m_selectedUnit.Speed);
             m_selectedUnit.CopyPath(m_pathFindingResults);
         }
         else
         {
             ClearPaths();
         }
     }
 }