public GameObject CreateTile(TileCreator.TileTypes type, int selectedFloor, int x = 0, int y = 0) { _selectedFloor = selectedFloor; _gridEditor = transform.GetComponent <GridEditor>(); Rect rect = gridCell.rect; float xOffset = x * (rect.width + GridEditor.Gap); float yOffset = y * (rect.height + GridEditor.Gap); GameObject tile = null; switch (type) { case TileCreator.TileTypes.Single: tile = InstantiateTile(TileCreator.TileTypes.Single, x, y, xOffset, -yOffset); break; case TileCreator.TileTypes.DoubleH: tile = InstantiateTile(TileCreator.TileTypes.DoubleH, x, y, xOffset + rect.width / 2, -yOffset); break; case TileCreator.TileTypes.DoubleV: tile = InstantiateTile(TileCreator.TileTypes.DoubleV, x, y, xOffset, -(yOffset + rect.height / 2)); break; } return(tile); }
public Importer(GridEditor gridEditor, BoardEditor boardEditor, FloorEditor floorEditor, TileEditor tileEditor) { _boardInfo = new BoardInfo(); _gridEditor = gridEditor; _boardEditor = boardEditor; _floorEditor = floorEditor; _tileEditor = tileEditor; }
public void SetNewPosition() { GridTile gridTile = GridEditor.SelectedCell; x = gridTile.x; y = gridTile.y; SetPosition(gridTile); GridEditor.ChangeSelectedCell(null); SetName(); }
public void Initialize(GridEditor gridEditor) { _gridEditor = gridEditor; Renderer r = GetComponent <Renderer>(); _material = new Material(r.sharedMaterial); r.sharedMaterial = _material; Unselect(); }
public Exporter(List <EditorTile> editorTiles, GridEditor gridEditor, FloorEditor floorEditor) { _gridEditor = gridEditor; _floorEditor = floorEditor; _editorTiles = editorTiles; }