1

If I have 4 different canvases for 4 different UI screens in one scene. And each canvas has multiple panels inside.

Canvas list:

  • Pause
  • Game Finish
  • Gameplay
  • Settings

Then what is the best practice for best performance, and no extra overhead at runtime for the following situations? I am not caring about the scene loading time at the moment. I am targeting Android platform, med end devices mainly.

  1. I keep all the canvas game objects active by default in the scene and in Start() function I am disabling all canvases expect Gameplay so that you only see gameplay UI when the game starts.

or

  1. I keep all the canvas game objects disabled by default in the scene. So when the game starts, I am enabling Gameplay canvas in Start() menu and rest of them in different situations?

Here are my doubts,

  • Will there be any memory related performance differences?
  • Is loading time affected?
  • Will I have any CPU overhead or spikes if I activate any canvas object at run time for the first time, which was never active when the scene started?
  • 1
    Keep all except Gameplay inactive and keep Gameplay active...? – Immersive Jan 21 '21 at 05:40
  • You mean its a better option compared to keeping all active? – Riddhesh Zaveri Jan 21 '21 at 13:49
  • 1
    Yes. There's no difference to loading time or performance except in the first frame where you process which Canvases you want active. Depending on how much you do in Start, this can hang the first frame for a noticeable time. Having the initial state correct *before* Start means the user immediately sees what they expect, even if it's frozen for a short time. – Immersive Jan 21 '21 at 23:29

0 Answers0