Exemple #1
0
    public override void RaiseEventTileSwitchAnimBegan(Match3Tile neighborTile)
    {
        base.RaiseEventTileSwitchAnimBegan(neighborTile);

        if (neighborTile is BombTile)
        {
            BombTile neighborBomb = neighborTile as BombTile;
            // Mark this tile and it's neighbor as moving and without any gravity because there will be a custom animation on them
            // to try and keep things consistent.
            neighborBomb.DisableTileLogic();
            DisableTileLogic();

            // Prepare the bigger directional destroy effect on this directional tile.
            prefabTilesDestroyEffect = prefabBombCombineDestroyEffect;
        }

        if (neighborTile is DirectionalDestroyTile)
        {
            DirectionalDestroyTile directionalTile = neighborTile as DirectionalDestroyTile;
            directionalTile.SwitchBackOnMatchFail = false;
            SwitchBackOnMatchFail = false;

            CanBeMatched = false;
            (neighborTile as NormalTile).CanBeMatched = false;
        }
    }
    public override void RaiseEventTileSwitchAnimBegan(Match3Tile neighborTile)
    {
        base.RaiseEventTileSwitchAnimBegan(neighborTile);

        if ((neighborTile is BombTile || neighborTile is ColorBombTile) && TappedFirst)
        {
            Match3BoardGameLogic.Instance.loseConditions.NewMove();
        }

        if (neighborTile is BombTile)
        {
            // Don't allow this tile and it's neighbour with who it was switched to switch back on match fail.
            BombTile neighborBomb = neighborTile as BombTile;
            neighborBomb.SwitchBackOnMatchFail = false;
            neighborBomb.DisableTileLogic();
            // Replace the default destroy effect with a bigger destroy effect
            neighborBomb.prefabDestroyEffect = neighborBomb.prefabDoubleDestroyEffect;
            neighborBomb.useBigTimeBomb      = true;
        }
    }