void Start()
        {
            var columns       = 13; // 13 columns for all the letters 26 / 2
            var rows          = 2;  // 2 rows for all the letters 26 / 13
            var rectTransform = gameObject.GetComponent <RectTransform>();
            var calculator    = new CellSizeCalculator(rectTransform, rows, columns);

            // setting the cell size to match screen resolution
            var gridLayout = gameObject.GetComponent <GridLayoutGroup>();

            gridLayout.cellSize = calculator.GetOptimalCellSize();

            MakeLetterTile();
        }
Пример #2
0
        private void Start()
        {
            var letterGameController = LetterLevelController.Instance;

            boardSizeX = letterGameController.BSizeX;
            boardSizeY = letterGameController.BSizeY;

            var gridLayout      = gameObject.GetComponent <GridLayoutGroup>();
            var playBoardCanvas = gameObject.GetComponent <RectTransform>();

            calculator          = new CellSizeCalculator(playBoardCanvas, boardSizeY, boardSizeX);
            gridLayout.cellSize = calculator.GetOptimalCellSize();

            FillPlayingBoard();
        }