예제 #1
0
    }//GetRowPieces

    public void CheckBombs(MatchType matchType)
    {
        //Did the player move something?
        if (board.currentDot != null)
        {
            //Is the piece they moved matched?
            if (board.currentDot.isMatched && board.currentDot.tag == matchType.color)
            {
                //make it unmatched
                board.currentDot.isMatched = false;
                if ((board.currentDot.swipeAngle > -45 && board.currentDot.swipeAngle <= 45) ||
                    (board.currentDot.swipeAngle < -135 || board.currentDot.swipeAngle >= 135))
                {
                    board.currentDot.MakeRowBomb();
                }
                else
                {
                    board.currentDot.MakeColumnBomb();
                }
            }
            //Is the other piece matched?
            else if (board.currentDot.otherDot != null)
            {
                Dots otherDot = board.currentDot.otherDot.GetComponent <Dots>();
                //Is the other Dot matched?
                if (otherDot.isMatched && otherDot.tag == matchType.color)
                {
                    //Make it unmatched
                    otherDot.isMatched = false;
                    if ((board.currentDot.swipeAngle > -45 && board.currentDot.swipeAngle <= 45) ||
                        (board.currentDot.swipeAngle < -135 || board.currentDot.swipeAngle >= 135))
                    {
                        otherDot.MakeRowBomb();
                    }
                    else
                    {
                        otherDot.MakeColumnBomb();
                    }
                }
            }
        }
    }
예제 #2
0
    public void CheckBombs() //row ve column bombun mouse acisina gore olusturulmasi
    {
        if (board.currentDot != null)
        {
            if (board.currentDot.isMatched == true)
            {
                board.currentDot.isMatched = false;

                if ((board.currentDot.angle > -45 && board.currentDot.angle <= 45) || (board.currentDot.angle > 135 && board.currentDot.angle <= 225))
                {
                    board.currentDot.MakeRowBomb();
                }
                else
                {
                    board.currentDot.MakeColumnBomb();
                }
            }
            else if (board.currentDot.otherDot != null)
            {
                Dots otherDot = board.currentDot.otherDot.GetComponent <Dots>();
                if (otherDot.isMatched)
                {
                    otherDot.isMatched = false;

                    if ((board.currentDot.angle > -45 && board.currentDot.angle <= 45) || (board.currentDot.angle > 135 && board.currentDot.angle <= 225))
                    {
                        otherDot.MakeRowBomb();
                    }
                    else
                    {
                        otherDot.MakeColumnBomb();
                    }
                }
            }
        }
    }