Ejemplo n.º 1
0
 public void ModifyTileAt(Vector2Int tile, EditorUIController.Buttons element)
 {
     if (EditableTile(tile))
     {
         if (element == EditorUIController.Buttons.FLOOR)
         {
             if (GetFieldTypeAt(tile.x, tile.y, true) == FieldType.EMPTY)
             {
                 SetTileAt(tile.x, tile.y, FieldType.FLOOR);
             }
             else if (GetFieldTypeAt(tile.x, tile.y, true) == FieldType.FLOOR)
             {
                 SetTileAt(tile.x, tile.y, FieldType.EMPTY);
             }
             else if (GetFieldTypeAt(tile.x, tile.y, true) == FieldType.WALL)
             {
                 SetTileAt(tile.x, tile.y, FieldType.FLOOR);
             }
         }
         else
         {
             if (GetFieldTypeAt(tile.x, tile.y, true) == FieldType.FLOOR)
             {
                 Vector2Int editableTile = new Vector2Int(tile.x - 1, tile.y - 1);
                 if (GetElementAt(editableTile) == Elements.EMPTY)
                 {
                     SetElementAt(editableTile, (Elements)element);
                 }
                 else
                 {
                     SetElementAt(editableTile, Elements.EMPTY);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void Button_ChooseItem(int order)
 {
     chosenItem = (EditorUIController.Buttons)order;
 }