public void CreateTile(int i, int j, int type, MatchType remover = MatchType.Normal) { var newTile = _factory.Create(type, new Point2D(i, j));// tiles[i, j] = newTile; _tilebuilder?.BindTileResource(newTile); tiles[i, j].SetRemoverType(remover); }
public void Start() { // start 1 tile back so main menu looks normal Tile start = (Tile)_tileFactory.Create(); float initZ = -1 * start.meshCollider.bounds.size.z; start.transform.position = new Vector3(0.0f, 0.0f, initZ); _tiles.AddLast(start); for (int i = 1; i < _settings.preGenerateCount; i++) { Generate(Vector3.zero, false); } }
/// <summary> /// Получить скрытый тайл или создать новый /// </summary> /// <param name="pos">Позиция тайла</param> public Tile AddTile(Vector3 pos) { var tile = _tileFactory.Create(pos); _tiles.Add(tile); return(tile); }