Ejemplo n.º 1
0
 // Finds and highlights the the squares within movement range
 public void Highlight()
 {
     if (!highlighted)
     {
         GridHandler gridhandler = GameObject.FindWithTag("GridHandler").GetComponent <GridHandler>();
         movement = gridhandler.FindSquares(_fig, steps);
         foreach (GameObject square in movement)
         {
             Renderer renderer = square.GetComponent <Renderer>();
             renderer.material.SetColor("_Color", new Color(0, 0xba, 0xbe));
         }
         highlighted = true;
     }
     else
     {
         foreach (GameObject square in movement)
         {
             Renderer renderer = square.GetComponent <Renderer>();
             renderer.material.SetColor("_Color", tableCloth.color);
         }
         highlighted = false;
     }
 }