Exemplo n.º 1
0
    public void WriteX()
    {
        GetComponentInChildren <Text>().text = "X";
        GetComponent <Button>().interactable = false;
        gm.Tab[int.Parse(gameObject.name)]   = "X";

        if (gm.isWinner("X"))
        {
            gm.GameOver("X");
        }
        else if (gm.ArrayIsFull())
        {
            gm.Draw();
        }
        else
        {
            gm.ComputerPlay();
        }
    }
Exemplo n.º 2
0
    public void WriteX()
    {
        GetComponentInChildren <Text>().text = "X";
        GetComponent <Button>().interactable = false;
        gm.Tab[int.Parse(gameObject.name)]   = "X";

        if (gm.isWinner("X"))
        {
            Debug.Log("X a gagné...");
            gm.panel.SetActive(true);
        }
        else if (gm.ArrayIsFull())
        {
            Debug.Log("Match Nul...");
            gm.TabColorBlue();
            gm.panel.SetActive(true);
        }
        else
        {
            gm.ComputerPlay();
        }
    }