Пример #1
0
        public void GenerateEmptyBoard(int _size)
        {
            DestroyAllChildren(gridObject.transform);
            InitializeDependencies();
            GridLayoutGroup gridLayoutGroup = gridObject.GetComponent <GridLayoutGroup>();

            gridLayoutGroup.constraintCount = _size;

            for (int i = 0; i < (_size * _size); i++)
            {
                CellScript cell = Instantiate(singleCellPrefab, gridObject.transform).GetComponent <CellScript>();
                cell.InitializeEmptyCell();
                m_cellList.Add(cell);
            }
        }
Пример #2
0
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else
            {
                Destroy(gameObject);
            }

            // Desactivating all Save related panels
            generateBoardPanel?.SetActive(false);
            saveBoardPanel?.SetActive(false);
            boardSavedPanel?.SetActive(false);
            overrideFilePanel?.SetActive(false);

            // Desactivating all Load related panels.
            loadBoardPanel?.SetActive(false);

            // Initializing Feedback Section
            currentlySelectedBuildingBlock.InitializeEmptyCell();
        }