Example #1
0
        void PaintCountries()
        {
            // Color some countries to show different cross cost
            List <int> cellsInCountry = map.GetCellsInCountry(map.GetCountryIndex("France"));

            for (int k = 0; k < cellsInCountry.Count; k++)
            {
                map.ToggleCellSurface(cellsInCountry [k], true, new Color(1, 1, 1, 0.25f));
                map.PathFindingCellSetAllSidesCost(cellsInCountry [k], 3);
            }
            cellsInCountry = map.GetCellsInCountry(map.GetCountryIndex("Germany"));
            for (int k = 0; k < cellsInCountry.Count; k++)
            {
                map.ToggleCellSurface(cellsInCountry [k], true, new Color(0, 1, 0, 0.25f));
                map.PathFindingCellSetAllSidesCost(cellsInCountry [k], 2);
            }
        }
		/// <summary>
		/// Fade out all cells in current country in blue
		/// </summary>
		void PaintCurrentCountry () {
			if (map.countryHighlightedIndex < 0)
				return;
			List<int> cellsInCountry = map.GetCellsInCountry (map.countryHighlightedIndex);
			for (int k = 0; k < cellsInCountry.Count; k++) {
				map.CellFadeOut (cellsInCountry [k], Color.blue, 2.0f);
			}
		}