예제 #1
0
 public void moveGoti(int current, int next)
 {
     if (next >= 0)
     {
         try
         {
             if (!this.isMoving)
             {
                 StartCoroutine(moveGotiSteps(next));
             }
         }
         catch (System.Exception ex)
         {
             Debug.Log("moveGoti Exception " + ex.Message);
         }
     }
     if (next == -1)
     {
         transform.position   = InitialPositionVector;
         transform.localScale = new Vector3(1f, 1f, 1f);
         currentPosition      = -1;
         isLock = true;
         LudoDelegate.closeGoti();
         this.CellNumber = -1;
     }
     LudoDelegate.refreshCell();
 }
예제 #2
0
 bool checkForGotiCut()
 {
     foreach (GameObject myGoti in playerList[currentPlayer].getPlayeGoti())
     {
         int myPosition = myGoti.GetComponent <GotiScript>().CellNumber;
         if (!checkSafePlace(myPosition))
         {
             if (myPosition >= 0)
             {
                 for (int i = 0; i < playerList.Length; i++)
                 {
                     if (i != this.currentPlayer)
                     {
                         int numberoOfGoti = 0;
                         int gotiIndex     = 0;
                         foreach (GameObject opponent in playerList[i].getPlayeGoti())
                         {
                             int opponentPosition = opponent.GetComponent <GotiScript>().CellNumber;
                             if (myPosition == opponentPosition)
                             {
                                 numberoOfGoti++;
                                 gotiIndex = opponent.GetComponent <GotiScript>().index;
                             }
                         }
                         if (numberoOfGoti == 1)
                         {
                             LudoDelegate.closeGoti();
                             Debug.Log(playerList[currentPlayer].getName() + " find Goti of " + playerList[i].getName() + " at " + myPosition);
                             playerList[i].MoveGoti(gotiIndex, myPosition, -1);
                             return(true);
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }