private void UpdateCurvature()
        {
            if (cachedMesh == null || controller == null)
            {
                return;
            }

            helper.PokeScreenSize();

            var settings = controller.CurrentCurveSettings;

            newVertices.Clear();

            foreach (var v in cachedVertices)
            {
                newVertices.Add(helper.GetCurvedPosition(v, localToCanvasMatrix, canvasToLocalMatrix, settings));
            }

            cachedMesh.SetVertices(newVertices);

            graphic.canvasRenderer.SetMesh(cachedMesh);
        }
Example #2
0
        public void UpdateCurvature()
        {
            if (controller == null || HasCurvedThisFrame)
            {
                return;
            }

            curvedHelper.PokeScreenSize();

            modifiedVertices.Clear();

            var settings = controller.CurrentCurveSettings;

            foreach (var v in cachedVertices)
            {
                modifiedVertices.Add(curvedHelper.GetCurvedPosition(v, ref localToCanvasMatrix, ref canvasToLocalMatrix, settings));
            }

            m_mesh.SetVertices(modifiedVertices);

            canvasRenderer.SetMesh(m_mesh);

            HasCurvedThisFrame = true;
        }