I have this procedure on the cells of the map.
It worked till yesterday, when i, that was coding other parts of the project, tested it and it didn’t work.
this is the code:
void OnMouseDown()
{
Debug.Log (“hmm”);
if(this.InVista[VariabiliComuni.turno])
this.renderer.material = VariabiliComuni.UMat.MaterialVector[2+codFazione*3];
if (VariabiliComuni.CelSel.Pos != Pos)
{
VariabiliComuni.Map.Celle [VariabiliComuni.CelSel.Pos.x, VariabiliComuni.CelSel.Pos.z].renderer.material = VariabiliComuni.UMat.MaterialVector[VariabiliComuni.CelSel.codFazione*3+((InVista[VariabiliComuni.IGiocanti[VariabiliComuni.turno].faz-1]) ? 0:1)];//ricordarsi di diminuire di 1 che invista non tiene conto del neutrale
VariabiliComuni.CelSel = this;
Debug.Log("Selected cell : "+Pos.x+","+Pos.z);
}
And as i clicked on the cells, the selected cell should change color, but it didn’t work.
Also the debug log dont write that it has been clicked, it seems that this function is never called.