void OnMouseDown() { if (!GameObject.Find(Constants.PieceNames.ChessBoard).GetComponent <GameKeeper>().isSideControlledByAI(this.movingPiece.side)) { MoveActions.standardMoveActions(new Move(this.movingPiece, this.movePosition)); GameObject.Find(Constants.PieceNames.ChessBoard).GetComponent <GameKeeper>().ClearTiles(); } }
public void PostAIComputation() { // Make sure this is done on the main thread // Since we've duplicated the chessboard, the piece associate with the move needs to be set to the actual game chessboard's instance this.isComputationDone = false; Move moveToMake = new Move(GameObject.Find(Constants.PieceNames.ChessBoard).GetComponent <GameKeeper>().chessBoard.GetPieceAtPosition(bestMove.getPiece().GetCurrentPosition()), bestMove.getPosition()); MoveActions.standardMoveActions(moveToMake); }