Пример #1
0
 public static void ModifyRoadCellsOnTheGrid(Dictionary <Vector3Int, GameObject> neighboursDictionar, StructureBaseSO structureData, Dictionary <Vector3Int, GameObject> structuresToBeModified, GridStructure grid, IPlacementManager placementManager)
 {
     foreach (var keyValuePair in neighboursDictionar)
     {
         grid.RemoveStructureFromTheGrid(keyValuePair.Key);
         placementManager.DestroySingleStructure(keyValuePair.Value);
         var roadStructure = GetCorrectRoadPrefab(keyValuePair.Key, structureData, structuresToBeModified, grid);
         var structure     = placementManager.PlaceStructureOnTheMap(keyValuePair.Key, roadStructure.RoadPrefab, roadStructure.RoadPrefabRotation);
         grid.PlaceStructureOnTheGrid(structure, keyValuePair.Key, GameObject.Instantiate(structureData));
     }
     neighboursDictionar.Clear();
 }