Пример #1
0
        void ShowPathAndCosts(List <int> path)
        {
            int steps = path.Count;

            Color pathColor = new Color(0.5f, 0.5f, 0, 0.5f);

            for (int k = 1; k < steps; k++)                     // ignore step 0 since this is current tank cell
            {
                int cellIndex = path [k];

                // Color path cells
                map.SetCellTemporaryColor(cellIndex, pathColor);

                // Show the accumulated cost
                int      accumCost    = map.GetCellPathCost(cellIndex);
                Vector3  cellPosition = map.GetCellPosition(cellIndex);
                TextMesh text         = map.AddMarker2DText(accumCost.ToString(), cellPosition);
                text.transform.localScale *= 0.3f;                      // make font smaller
                texts.Add(text);
            }
        }