public void aiTurn() { possibleMoves.Clear(); for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { if (logicManager.virtualGrid[x, y] == 0) { calculatePossibleMove(x, y); } } } possibleMoves.Sort((PossibleMove move1, PossibleMove move2) => move1.value.CompareTo(move2.value)); logicManager.click(possibleMoves[possibleMoves.Count - 1].location); print("AI has chosen " + possibleMoves [possibleMoves.Count - 1].location.x + ", " + possibleMoves [possibleMoves.Count - 1].location.y + " Value: " + possibleMoves [possibleMoves.Count - 1].value); }
void OnMouseDown() { gameLogicManager.click(gridIndex); myRenderer.color = baseColor; }