public void CreateMap(IMap map, bool createEmptyCells) { m_Root = new GameObject("map_root"); m_Cells = new GameObject[map.GetWidth()][]; for (int x = 0; x < map.GetWidth(); ++x) { m_Cells[x] = new GameObject[map.GetHeight()]; for (int y = 0; y < map.GetHeight(); ++y) { IMapCell mapCell = map.GetCell(x, y); if (!createEmptyCells && mapCell.GetCellType().Equals(0)) { continue; } byte cellPrefabIndex = mapCell.GetCellType(); byte surfaceType = mapCell.GetSurfaceType(); CreateCellAt(x, y, cellPrefabIndex, surfaceType); } } ICheckPointsManager checkPointsManager = map.GetCheckPointsManager(); foreach (ICheckPoint checkPoint in checkPointsManager.GetCheckPoints()) { CreateCheckPoint(checkPoint); } }