Tic Tac Toe Tutorail?

How can i check who won ?
public GameObject cross,nought;
public enum Seed{Empty,P1,P2};
public Seed turn;
public Text Instructions;
public AudioClip P1audio;
public AudioClip P2audio;
void Start(){
Instructions.text = "TURN: " + turn.ToString ();
public void SpawnNew(GameObject obj)
if (turn == Seed.P1) {
Instantiate (cross, obj.transform.position, Quaternion.identity);
turn = Seed.P2;
} else {
Instantiate (nought, obj.transform.position, Quaternion.identity);
turn = Seed.P1;
Destroy (obj.gameObject);
Instructions.text = "TURN: " + turn.ToString ();

It doesn’t seem like you’re tracking the X and O.
Also, obj.transform.position will always be at the same place, no?

To keep track of who’s can win, you just need to track the X and O using an array from 0 to 8.
So it’ll look like this:




// You can save O as 0 and X as 1 or something like that. Initialize the array with all 2s so that you won't get confused as to which position has already been taken.
public int[] track = new track[10];

public CheckForWin()
   // You can manually type the rest since there are only 8 win conditions in Tic Tac Toe.
   if(track[0] == track[1] && track[0] == track[2])
      // First row win.