private void CreateNewObstacle()
 {
     NewObstacle = MapControl2.AvailableElements.Where(e => !e.Walkable).Skip(SelectedObstacleIndex).First().Clone();
     NewObstacle.CreatePresentation();
     NewObstacle.GO.transform.parent = ElementBackground.transform.parent;
     NewObstacle.GO.transform.localPosition = ElementBackground.transform.localPosition + Vector3.up / 8;
     NewObstacle.GO.transform.localScale = Vector3.one / 4;
 }
 private void DestroyNewObstacle()
 {
     NewObstacle.DestroyPresentation();
     NewObstacle = null;
 }
 private void DestroyNewElement()
 {
     NewElement.DestroyPresentation();
     NewElement = null;
 }
Example #4
0
 public void Map(int x, int y, MapBlockModel block)
 {
     if (block == null)
         block = NullBlockModel.Instance;
     if (!MapStorage.ContainsKey(x))
         MapStorage.Add(x, new Dictionary<int, MapBlockModel>());
     if (MapStorage[x].ContainsKey(y)) {
         MapStorage[x][y].DestroyPresentation();
         MapStorage[x][y] = block;
     } else {
         MapStorage[x].Add(y, block);
     }
 }