How to make CanvasRenderer.SetMesh appear in the same frame?

I have a component derived from UI.Graphic and I’m calling SetMesh on the CanvasRenderer component, but that mesh will not appear until the next frame. I’ve tried setting the Mesh in OnEnable, Update, and LateUpdate, all with the same result - the mesh doesn’t render or appear until the following frame.

Is there a way to render the mesh immediately in the same frame that it’s set?


I fixed it by deriving from MonoBehavior instead. UI.Graphic was doing it’s own thing to set the mesh, which conflicted with mine. I wasn’t using the UI.Graphic way of setting the mesh with VertexHelper.