Пример #1
0
        private void ShowBorder(TMP_LineInfo lineInfo)
        {
            Transform legendTransform = m_legendMesh.transform;

            // Get line extents
            Vector3 bottomLeft = legendTransform.TransformPoint(lineInfo.lineExtents.min);
            Vector3 topRight   = legendTransform.TransformPoint(lineInfo.lineExtents.max);

            // Add left/right padding to x-axis values
            bottomLeft.x -= 1.05F;
            topRight.x   += 0.2F;

            // Adjust y-axis by legend location
            float legendY = legendTransform.position.y + 0.28F;

            bottomLeft.y -= legendY;
            topRight.y   -= legendY;

            // Make sure border is drawn above (i.e., at a higher z-coordinate) than legend
            float borderZ = bottomLeft.z - 0.1F;

            bottomLeft.z = borderZ;
            topRight.z   = borderZ;

            m_border.MakeRoundedRect(bottomLeft, topRight, 0.35F, 2);
            m_border.active = true;
        }
    void Start()
    {
        //VectorLine.SetCamera3D();
        //Vector2[] linePoints = {new Vector2(0,0),new Vector2(1,1)};
        //VectorLine myline = new VectorLine.SetLine(Color.green, new Vector2(0, 0), new Vector2(1, 1));
        Vector2[]  linePoints = { new Vector2(0, 0), new Vector2(1, 1) };
        Material   line       = (Material)Resources.Load("Line");
        VectorLine myline     = new VectorLine("MyLine", linePoints, null, 0.05f, LineType.Continuous);
        //VectorLine.SetCanvasCamera (Camera.main);


        //c.re

        Rect r = new Rect(0, 0, 2, 1);

        //myline.make
        myline.MakeRoundedRect(r, 0.2f, 10);
        myline.SetColor(Color.black);

        myline.Draw();
    }