public List <PathPoint> FindPointsToCharacter(int NestLevel, Vector2 characterPosition) { if (NestLevel <= pathFindMaxDepth) { // Получаем точки текущей итерации List <PathPoint> iterationPaths = allAvailablePaths.GetPointsWithNestLevel(NestLevel); // Проверяем клетки следующей итерации List <PathPoint> pointsToCharacter = CheckPathToCharacterAmongPaths(iterationPaths, characterPosition); if (pointsToCharacter != null && pointsToCharacter.Count > 0) { return(pointsToCharacter); } else { return(FindPointsToCharacter(NestLevel + 1, characterPosition)); } } else { return new List <PathPoint>() { } }; }