private void FillRow(int q, int r, Vector3 offset = default) { Tile tile = grid.TileAt(q, r); while (tile != null) { var bubble = spawner.CreateRandom(); bubble.Movement.Teleport(tile.transform.position + offset); grid.Attach(bubble, tile); tile = grid.Neighbour(tile, HexDirection.E); } }
private void FillRow(int q, int r, ref int exponent) { Tile tile = grid.TileAt(q, r); while (tile != null) { if (exponent >= values.Length) { return; } var value = values[exponent++]; if (value > 0) { var bubble = spawner.Create(new BubbleScore(value)); grid.Insert(bubble, tile); } tile = grid.Neighbour(tile, HexDirection.E); } }