Codesplosion
In earlier chapters, I've said that it's more important to get your code working than to make it elegant. However in some situations, like the one you're about to experience, the code is so preposterously inelegant that it cries out to be refactored on the spot.
Just like in math class where they make you add numbers up a million times before teaching multiplication, let's start by doing this the long way. Don't bother writing any of this code down. Just follow along, and look for ways in which it can be cleaned up.
We can look for 3-in-a-row as follows:
// Check the first row: if(aGrid[0,0].GetComponent.<Square>().player == currentPlayer && aGrid[1,0].GetComponent.<Square>().player == currentPlayer && aGrid[2,0].GetComponent.<Square>().player == currentPlayer) return true; // Check the second row: if(aGrid[0,1].GetComponent.<Square>().player == currentPlayer && aGrid[1,1].GetComponent.<Square>().player == currentPlayer &...