예제 #1
0
 public void CheckBombs()
 {
     //did the player move something
     if (Board.instance.currentDot != null)
     {
         //is the piece matched
         if (Board.instance.currentDot.isMatched)
         {
             Board.instance.currentDot.isMatched = false;
             //decide what kind of bomb
             if ((Board.instance.currentDot.swipeAngle > -45 && Board.instance.currentDot.swipeAngle <= 45) || (Board.instance.currentDot.swipeAngle < -135 || Board.instance.currentDot.swipeAngle >= 135))
             {
                 Board.instance.currentDot.MakeRowBomb();
             }
             else
             {
                 Board.instance.currentDot.MakeColumnBomb();
             }
         }
         else if (Board.instance.currentDot.otherDot != null)
         {
             DotController otherDot = Board.instance.currentDot.otherDot.GetComponent <DotController>();
             //other dot matched
             if (otherDot.isMatched)
             {
                 otherDot.isMatched = false;
                 //decide what kind of bomb
                 if ((Board.instance.currentDot.swipeAngle > -45 && Board.instance.currentDot.swipeAngle <= 45) || (Board.instance.currentDot.swipeAngle < -135 || Board.instance.currentDot.swipeAngle >= 135))
                 {
                     otherDot.MakeRowBomb();
                 }
                 else
                 {
                     otherDot.MakeColumnBomb();
                 }
             }
         }
     }
 }