Esempio n. 1
0
        public bool SetCellFull(Vector2 worldCellPos, Enums.TetroType type)
        {
            Vector3Int cellPos = grid.WorldToCell(worldCellPos);

            if (IsOutOfBounds(cellPos) || IsTooHigh(cellPos))
            {
                return(false);
            }
            cells[cellPos.x, cellPos.y].ChangeState(new ActiveCell(type));
            OnGridUpdated?.Invoke();
            return(true);
        }
Esempio n. 2
0
        public void SetColor(Enums.TetroType type)
        {
            var grid = FindObjectOfType <TetroGrid>();

            GetComponent <SpriteRenderer>().color = grid.ColorPalette.GetColorBasedOnType(type);
        }