示例#1
0
        private void Generate(int width, int height)
        {
            int numPoints = width * height;

            if (Algorithms.IsNumberOdd(numPoints))
                numPoints += 1;

            line = new VectorLine("Tile Map Grid", new Vector3[numPoints], null, GridWidth);

            int index = 0;
            for (int x = 0; x < width + 1; x++)
            {
                line.points3[index++] = new Vector3(x, 0.0f, 0.0f);
                line.points3[index++] = new Vector3(x, height, 0.0f);
            }
            for (int y = 0; y < height + 1; y++)
            {
                line.points3[index++] = new Vector3(0.0f, y, 0.0f);
                line.points3[index++] = new Vector3(width, y, 0.0f);
            }

            VectorLine.canvas3D.pixelPerfect = true;
            VectorLine.canvas3D.sortingLayerName = "Pathfinding";
            VectorLine.canvas3D.sortingOrder = 1;

            line.SetColor(new Color(0.0f, 0.0f, 0.0f, GridOpacity));
            line.Draw3DAuto();
        }
示例#2
0
 void Start()
 {
     line = new VectorLine("PathLine", new Vector3[numPoints], null, 2, LineType.Continuous);
     line.SetColor(new Color(1, 0, 0));
     VectorManager.useDraw3D = true;
     VectorManager.ObjectSetup(gameObject, line, Visibility.Dynamic, Brightness.None);
 }