Exemple #1
0
	void ClickableSpace(){
		for (int x = 0; x < width; x++) {
			for (int y = 0; y < height; y++) {


				GameObject Hex_go = GameObject.Find ("Hex_" + x + "_" + y);
				HexInfo ActualHex = Hex_go.GetComponentInChildren<HexInfo> ();
				MeshRenderer ActualHexRend = ActualHex.GetComponent<MeshRenderer>();

				for (int i = 0; i < 6; i++) {

					if (ActualHex.neigbours [i] != null) {

						if (ActualHex.neigbours [i].Nucli ) {
							ActualHex.Clickable = true;
							ActualHexRend.material.mainTexture = null;
						}

						for(int j=0;j<6;j++){
							
							if (ActualHex.neigbours [i].neigbours [j]!= null) {
								if (ActualHex.neigbours [i].neigbours [j].Nucli) {
									ActualHex.Clickable = true;
									ActualHexRend.material.mainTexture = null;
								}
							} 
						}
					}
				}
			}
		}
	}
 void ResetHexagonColorValues(HexInfo ActualHex)
 {
     ActualHex.HexColor             = 'W';
     ActualHex.transform.localScale = new Vector3(1, 1, 1);
     ActualHex.GetComponent <Renderer>().material.mainTexture = buildManagerInstance.defaultTexture;
     ActualHex.ColorDensity = 0;
 }