Beispiel #1
0
 //enquanto o mouse tiver em cima pode-se mover a peça para essa posição
 void OnMouseOver()
 {
     if (Input.GetMouseButtonDown(0))
     {
         sp.cleanSelection(false);
         ps.movePiece(null, this.gameObject);
     }
 }
Beispiel #2
0
 public void mudaTurno()
 {
     if (turno == 2)
     {
         turno = 1;
         // Debug.Log("IA pensando");
         // ia.buscar();
         coll = white.GetComponentsInChildren <Collider>();
         foreach (Collider c in coll)
         {
             c.enabled = true;
         }
         coll = black.GetComponentsInChildren <Collider>();
         foreach (Collider c in coll)
         {
             c.enabled = false;
         }
         if (player1.Equals("IA"))
         {
             StartCoroutine(RunIA(0, "White", mode));
         }
     }
     else if (turno == 1)
     {
         turno = 2;
         coll  = white.GetComponentsInChildren <Collider>();
         foreach (Collider c in coll)
         {
             c.enabled = false;
         }
         coll = black.GetComponentsInChildren <Collider>();
         foreach (Collider c in coll)
         {
             c.enabled = true;
         }
         if (player2.Equals("IA"))
         {
             StartCoroutine(RunIA(0, "Black", mode));
         }
     }
     sp.cleanSelection(true);
     cleanPromotePlat();
 }