Exemplo n.º 1
0
 public void Click()
 {
     if (transform.childCount == 0 && !CellHandler.Win)
     {
         Instantiate(X, transform);
         GetComponent <AudioSource>().PlayOneShot(FindObjectOfType <AudioClip>());
         cellHandler.Check();
     }
 }
Exemplo n.º 2
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (!cellHandler.Turn && transform.childCount == 0 && !CellHandler.Win)
     {
         List <GameObject> Index = new List <GameObject>();
         foreach (GameObject i in CellHandler.CellGo)
         {
             if (i.transform.childCount == 0)
             {
                 Index.Add(i);
             }
         }
         Thread.Sleep(1500);
         GetComponent <AudioSource>().PlayOneShot(FindObjectOfType <AudioClip>());
         Instantiate(O, Index[Random.Range(0, Index.Count)].transform);
         cellHandler.Check();
     }
 }