GraphicEntity2 AddRectAtPosition(int minX, int minY, int width, int height, Color color) { GridRect emptyRect = new GridRect(minX, minY, width, height); if (emptyRect != null) { var ge = GraphicEntity2.New(emptyRect, board); ge.SetColor(color); ge.SetOpacity(1, Beat(1)); return(ge); } return(null); }
public IList <GraphicEntity2> BreakToUnitSquares(float duration = 0) { var squares = new List <GraphicEntity2>(); foreach (var gridRect in rect.SplitToUnitSquares()) { var g = GraphicEntity2.New(gridRect, board); g.SetColor(animatable.color); squares.Add(g); } Remove(duration, DONTUNLOCK: true); return(squares); // splits existing x to this as much as it can }
GraphicEntity2 AddRect(int width, int height, Color color, bool allowStacking = false) { Debug.Log(width + " " + height); GridRect emptyRect = board.FindEmptyRectWithSize(width, height); if (emptyRect == null && allowStacking) { emptyRect = board.FindRandomRectWithSize(width, height); } if (emptyRect != null) { var ge = GraphicEntity2.New(emptyRect, board); ge.SetColor(color); //ge.SetOpacity(opacity, Beat(1)); return(ge); } return(null); }
bool AddRow(Color color, bool force = false) { // search for vacant spots // MUTEX Debug.Log("StoryOfASound: Looking for empty row"); GridRect emptyRow = board.FindEmptyRow(); Debug.Log("Found empty row" + emptyRow); if (emptyRow == null) { emptyRow = new GridRect(0, Random.Range(0, rows), cols, 1); foreach (var ge in board.GraphicEntities()) { ge.DeleteRect(emptyRow, Beat(1)); } } var newGe = GraphicEntity2.New(emptyRow, board); newGe.SetColor(color); //newGe.SetOpacity(1, Beat(1)); return(true); }
public void Duplicate(float duration = 0) { var ge = GraphicEntity2.New(rect, board); ge.ApplyActions(actions); }