Exemplo n.º 1
0
    private void MovePiecesActual(Vector2 direction)
    {
        TileController otherTile =
            Board.allTiles[(int)(posInArray.x + direction.x), (int)(posInArray.y + -direction.y)];

        SwitchPos(this, otherTile);
        if (tileType == TileType.BOOSTER)
        {
            behaviourScript?.ActivateBoosterBehaviour(otherTile);
            return;
        }
        if (otherTile.tileType == TileType.BOOSTER)
        {
            otherTile.behaviourScript?.ActivateBoosterBehaviour(this);
            return;
        }

        if (tileType == TileType.DEFAULT && otherTile.tileType == TileType.DEFAULT)
        {
            MatchController.singleton.CheckMove(this, otherTile);
        }
    }