void DrawTerrainUpdate() { foreach (string k in game.currentIsland.pathMap.Keys) { bbPos p = game.currentIsland.pathMap[k]; if (!goMap.ContainsKey(p)) { goMap[p] = InstantiateGo(pfTile, p.mapLoc, Color.white); goMap[p].GetComponentInChildren <bbClickable>().setPos(game.currentIsland.pathMap[k]); } Renderer r = goMap[p].GetComponentInChildren <Renderer>(); bbLand thisLand = game.currentIsland.lands[p]; if (thisLand.terrainType == bbTerrainType.OCEAN) { r.material.color = Color.blue; } else if (thisLand.terrainType == bbTerrainType.MOUNTAIN) { r.material.color = Color.black; } else { r.material.color = Color.gray; } if (thisLand.terrainFeature == bbTerrainFeature.ARABLE) { r.material.color = Color.green; } else if (thisLand.terrainFeature == bbTerrainFeature.MINEABLE) { r.material.color = Color.yellow; } } }
public void HighlightTile(bbPos p) { DrawTerrainUpdate(); goMap[p].GetComponent <Renderer>().material.color = Color.red; foreach (bbPos n in p.neighbors) { goMap[n].GetComponent <Renderer>().material.color = Color.red; } }
public void setPos(bbPos _pos) { pos = _pos; }