Esteban Ibarra

My currently unoptimized galaxy shooter UI.

In a nutshell, Unity recommends you separate your canvases based on whether you will update them or not. The canvas that you don’t update will have purely static elements and be called the static canvas. The canvas you do update will be the active one. The reason it’s done this way is when you modify an element inside a canvas, it’s considered ‘dirtying up the canvas’ and so every element inside of the canvas must be redrawn.

Unity also raycasts every image on the canvas. It’s important that if an image isn’t clickable, you turn off raycast target.

Don’t turn off the canvas object, instead turn off the canvas component. It’s more efficient.

Hope this helps! You can always check Unitys official optimization tips page for more updated information!

Coroutines are extremely useful for any time specific function, however when one uses the yield return new function, that uses a lot of garbage allocation resources as every time the new keyword is used, Unity has to build that new thing on the spot.

Wow! What a journey it’s been! I’ve now programmed my first space shooter game, learned game programming in various styles from 2d, 2.5d, and a simple zombie fps to learning about more serious applications that take advantage of Augmented Reality and Amazon services! While I’m learning about optimization, I’ll also be attempting to create some games so stay tuned!