Unity's [UI optimization tutorial][1] mentions that one way to optimize hiding parts of the UI would be by **Disabling Canvas Renderers**.
However, they don't exactly say how this should be done, and I haven't found that on the current [documentation for Canvas Renderers][2] or the [legacy one][3] (since this tutorial was checked with Unity 5.3).
The only thing they say is that what should be done is to
> [...] place the UI to be shown/hidden onto its own Canvas or Sub-canvas and then to merely enable/disable the Canvas Renderer component attached to that Canvas or Sub-canvas.
Is there a way to actually enable/disable the Canvas Renderer component or is there another optimized way to stop rendering UI Graphic components from a Sub-canvas without discarding VBO data?
I know that I can hide the UI objects by disabling the Canvas, disabling the GameObject or setting the Canvas Group alpha to 0, but I really need to make a WebGL build as optimized as possible, since the client needs it to run on an iPad, so please help me if you can.
Thanks.
[1]: https://unity3d.com/pt/learn/tutorials/topics/best-practices/other-ui-optimization-techniques-and-tips#disabling-canvas-renderers
[2]: https://docs.unity3d.com/ScriptReference/CanvasRenderer.html
[3]: https://docs.unity3d.com/530/Documentation/ScriptReference/CanvasRenderer.html
↧