public void OnTileTapped(AbstractTile tile) { BoardCoord targetCoord = tile.BoardPiece.BoardPosition; if (selectedTile == typeof(BombTile)) { GameObject.Destroy(tile.gameObject); BombTile newTile = Match3BoardRenderer.Instance.SpawnSpecificTileAt(targetCoord, selectedTile, TileColorType.None) as BombTile; newTile.TileColor = RuleEntry.genericColors[Random.Range(0, Match3BoardRenderer.maxNumBoardColors)]; newTile.UpdateMaterial(); } else if (selectedTile == typeof(DirectionalDestroyTile)) { GameObject.Destroy(tile.gameObject); DirectionalDestroyTile newTile = null; if (Random.value > 0.5f) { newTile = Match3BoardRenderer.Instance.SpawnSpecificTileAt(targetCoord, typeof(RowDestroyTile), TileColorType.None) as DirectionalDestroyTile; } else { newTile = Match3BoardRenderer.Instance.SpawnSpecificTileAt(targetCoord, typeof(ColumnDestroyTile), TileColorType.None) as DirectionalDestroyTile; } newTile.TileColor = RuleEntry.genericColors[Random.Range(0, Match3BoardRenderer.maxNumBoardColors)]; newTile.UpdateMaterial(); } else if (selectedTile == typeof(ColorBombTile)) { GameObject.Destroy(tile.gameObject); ColorBombTile newTile = Match3BoardRenderer.Instance.SpawnSpecificTileAt(targetCoord, selectedTile, TileColorType.None) as ColorBombTile; } }
protected override void DoItem() { if (tileToDestroy) { AbstractBoardPiece BoardPiece = tileToDestroy.BoardPiece; BoardPiece.Tile = (boardLogic.boardRenderer as Match3BoardRenderer).SpawnSpecificTileAt(BoardPiece.BoardPosition.row, BoardPiece.BoardPosition.col, typeof(ColorBombTile), TileColorType.None); glacierTile = BoardPiece.Tile as ColorBombTile; //glacierTile.StartCoroutine(glacierTile.StartIdleAnim()); tileToDestroy.tileModelRenderer.enabled = false; // tileToDestroy.AddScore(); } WaitAndDestroyTile(); }
protected override void DoItem() { if (tileToDestroy) { AbstractBoardPiece BoardPiece = tileToDestroy.BoardPiece; BoardPiece.Tile = (boardLogic.boardRenderer as Match3BoardRenderer).SpawnSpecificTileAt(BoardPiece.BoardPosition.row, BoardPiece.BoardPosition.col, typeof(ColorBombTile), TileColorType.None); glacierTile = BoardPiece.Tile as ColorBombTile; //glacierTile.StartCoroutine(glacierTile.StartIdleAnim()); tileToDestroy.tileModelRenderer.enabled = false; // tileToDestroy.AddScore(); } WaitAndDestroyTile(); }
public void OnColorBombColorBombCombineSndEvent(ColorBombTile colorBombTile) { // sndColorBombColorBombCombine.Play(); SoundManager.Instance.PlayOneShot(sndColorBombColorBombCombine); }
public void OnTriggerColorBombSndEvent(ColorBombTile colorBombTile) { sndTriggerColorBomb.Play(); }
public void OnColorBombColorBombCombineSndEvent(ColorBombTile colorBombTile) { // sndColorBombColorBombCombine.Play(); SoundManager.Instance.PlayOneShot(sndColorBombColorBombCombine); }
public void OnTriggerColorBombSndEvent(ColorBombTile colorBombTile) { sndTriggerColorBomb.Play(); }