Exemplo n.º 1
0
 //駒移動
 public void MoveChessman(int x, int y)
 {
     if (allowedMove[x, y])
     {
         Chessman c;
         c = Chessmans [x, y];
         if (c != null && c.isWhite != isWhiteTurn)
         {
             if (c.GetType() == typeof(King))
             {
                 EndGame("勝ち");
             }
             //ai.
             EnemyChessmans.Remove(c);
             activeChessman.Remove(c.gameObject);
             Destroy(c.gameObject);
         }
         Debug.Log("move");
         Chessmans [selectedChessman.CurrentX, selectedChessman.CurrentY] = null;
         selectedChessman.transform.position = GetTileCenter(x, y);
         selectedChessman.Setposition(x, y);
         Chessmans [x, y] = selectedChessman;
         isWhiteTurn      = !isWhiteTurn;
     }
     //selectedChessman = null;
     BoardHighlight.Instance.Hidehighlits();
     selectedChessman = null;
     turnText.text    = "ENEMY";
 }