コード例 #1
0
 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;
 }
コード例 #2
0
 private void DestroyNewObstacle()
 {
     NewObstacle.DestroyPresentation();
     NewObstacle = null;
 }
コード例 #3
0
 private void DestroyNewElement()
 {
     NewElement.DestroyPresentation();
     NewElement = null;
 }
コード例 #4
0
ファイル: MapControl2.cs プロジェクト: kraidiky/RoyalInsomnia
 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);
     }
 }