void PushNewLetter() { GameObject tileGameObject = TileFactoryPool.GetTile(); LetterTileModel newTileModel = gameState.PullTileFromBag(); LetterTileView tileView = tileGameObject.GetComponent <LetterTileView> (); newTileModel.activateTile(tileView); tileView.activate(newTileModel, LetterTileClickHandler); belt.AddTile(tileView); int num = gameState.GetNumActiveTiles(); if (num >= maxActiveLetters) { RemoveOldestLetter(); } }
void KillTile(LetterTileModel tile) { if (tile.state == LetterTileModel.STATE_DEAD) { return; } tile.state = LetterTileModel.STATE_DEAD; gameState.RemoveActiveTile(tile); playHolder.removeTile(tile.tileView); gameState.RemoveTileFromPlay(tile); if (gameState.isTileOnBelt(tile)) { tile.state = LetterTileModel.STATE_ONBELT; belt.repositionTiles(); } TileFactoryPool.ReturnTile(tile.tileView.gameObject); belt.removeTile(tile.tileView); belt.MoveTileToStart(tile.tileView); tile.deactivateTile(); }