private void UpdateCurvature() { if (controller == null) { return; } curvedHelper.PokeScreenSize(); modifiedVertices.Clear(); var settings = controller.CurrentCurveSettings; var worldToLocal = m_rectTransform.worldToLocalMatrix; var localToWorld = m_rectTransform.localToWorldMatrix; foreach (var v in cachedVertices) { var canvasSpace = cachedCanvasWorldToLocalMatrix.MultiplyPoint(localToWorld.MultiplyPoint(v)); curvedHelper.ModifyCurvedPosition(ref canvasSpace, settings); modifiedVertices.Add(worldToLocal.MultiplyPoint(cachedCanvasLocalToWorldMatrix.MultiplyPoint(canvasSpace))); } m_mesh.SetVertices(modifiedVertices); canvasRenderer.SetMesh(m_mesh); }
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); }
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; }