Пример #1
0
    public void UpdateDisplay(BoardModel board, ActiveBricks bricks, TileSet tileSet)
    {
        int color = board.GetTile(_x, _y);

        if (color == 0 && bricks != null)
        {
            color = bricks.GetBrickAt(_x, _y);
        }

        if (_renderer == null)
        {
            _renderer = this.GetComponentInChildren <Renderer>();
        }

        if (color > 0)
        {
            _renderer.enabled  = true;
            _renderer.material = tileSet.TileMaterials[color - 1];
        }
        else
        {
            _renderer.enabled = false;
        }
    }