Exemplo n.º 1
0
    public void CheckBombs()
    {
        if (board.selectedGem != null)
        {
            if (board.selectedGem.isMatched)
            {
                board.selectedGem.isMatched = false;

                if ((board.selectedGem.swipeAngle > -45 && board.selectedGem.swipeAngle <= 45) ||
                    (board.selectedGem.swipeAngle < -135 || board.selectedGem.swipeAngle >= 135))
                {
                    board.selectedGem.RowBombSpawner();
                }
                else
                {
                    board.selectedGem.ColumnBombSpawner();
                }
            }

            else if (board.selectedGem.sideGem != null)
            {
                GemManager sideGem = board.selectedGem.sideGem.GetComponent <GemManager>();

                if (sideGem.isMatched)
                {
                    sideGem.isMatched = false;

                    if ((board.selectedGem.swipeAngle > -45 && board.selectedGem.swipeAngle <= 45) ||
                        (board.selectedGem.swipeAngle < -135 || board.selectedGem.swipeAngle >= 135))
                    {
                        sideGem.RowBombSpawner();
                    }
                    else
                    {
                        sideGem.ColumnBombSpawner();
                    }
                }
            }
        }
    }