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); }
public void SetColor(Enums.TetroType type) { var grid = FindObjectOfType <TetroGrid>(); GetComponent <SpriteRenderer>().color = grid.ColorPalette.GetColorBasedOnType(type); }