Exemplo n.º 1
0
    public Tile GetTetriminoTile(Tetrimino.eTetriminoType _tetriminoType)
    {
        switch (_tetriminoType)
        {
        case Tetrimino.eTetriminoType.TYPE_I:
            return(m_tetriminoTypeITile);

        case Tetrimino.eTetriminoType.TYPE_O:
            return(m_tetriminoTypeOTile);

        case Tetrimino.eTetriminoType.TYPE_T:
            return(m_tetriminoTypeTTile);

        case Tetrimino.eTetriminoType.TYPE_L:
            return(m_tetriminoTypeLTile);

        case Tetrimino.eTetriminoType.TYPE_J:
            return(m_tetriminoTypeJTile);

        case Tetrimino.eTetriminoType.TYPE_Z:
            return(m_tetriminoTypeZTile);

        case Tetrimino.eTetriminoType.TYPE_S:
            return(m_tetriminoTypeSTile);

        case Tetrimino.eTetriminoType.BLANK:
        default: return(m_backgroundTileA);
        }
    }
Exemplo n.º 2
0
    public bool Refresh()
    {
        //for each tile of tileMap, refresh its color depending on GameGrid's Cell TetriminoType
        for (int i = 0; i < m_gridSizeX; i++)
        {
            for (int j = 0; j < m_gridSizeY; j++)
            {
                Tetrimino.eTetriminoType tetriType = m_gameflowManager.GetCellTetriminoType(i, j);

                Tile tile = m_tileMap.GetTile(new Vector3Int(i, j, 0)) as Tile;

                if (tetriType != Tetrimino.eTetriminoType.BLANK)
                {
                    tile = GetTetriminoTile(tetriType);
                }
                else
                {
                    tile = i % 2 == 0 ? m_backgroundTileA : m_backgroundTileB;                     //if there is no Cell, put background tiles
                }
                m_tileMap.SetTile(new Vector3Int(i, j, 0), tile);
            }
        }

        return(true);
    }
Exemplo n.º 3
0
 public void SetCellTetriminoType(Tetrimino.eTetriminoType _type)
 {
     m_tetriminoType = _type;
 }