Пример #1
0
        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);
        }
Пример #2
0
 public Importer(GridEditor gridEditor, BoardEditor boardEditor, FloorEditor floorEditor, TileEditor tileEditor)
 {
     _boardInfo   = new BoardInfo();
     _gridEditor  = gridEditor;
     _boardEditor = boardEditor;
     _floorEditor = floorEditor;
     _tileEditor  = tileEditor;
 }
Пример #3
0
        public void SetNewPosition()
        {
            GridTile gridTile = GridEditor.SelectedCell;

            x = gridTile.x;
            y = gridTile.y;
            SetPosition(gridTile);
            GridEditor.ChangeSelectedCell(null);
            SetName();
        }
Пример #4
0
        public void Initialize(GridEditor gridEditor)
        {
            _gridEditor = gridEditor;

            Renderer r = GetComponent <Renderer>();

            _material        = new Material(r.sharedMaterial);
            r.sharedMaterial = _material;

            Unselect();
        }
Пример #5
0
 public Exporter(List <EditorTile> editorTiles, GridEditor gridEditor, FloorEditor floorEditor)
 {
     _gridEditor  = gridEditor;
     _floorEditor = floorEditor;
     _editorTiles = editorTiles;
 }